1.4.5 • Published 4 years ago
@jakehamilton/dts-webpack-plugin v1.4.5
@jakehamilton/dts-webpack-plugin
Generate type definitions after your webpack build.
Installation
npm install --save-dev @jakehamilton/dts-webpack-pluginUsage
const DTSWebpackPlugin = require("@jakehamilton/dts-webpack-plugin");
module.exports = {
    plugins: [
        new DTSWebpackPlugin({
            // Optional root directory to search for package.json,
            // tsconfig.json, and code in.
            root: "/my/project/",
            // Optional arguments for the typescript compiler.
            tsc: "--strict",
            // Optional path to a tsconfig.json file.
            tsconfig: "/my/project/tsconfig.json",
            // Optional function to determine whether a module should be
            // included or not.
            match: (name) => !name.endsWith(".stories.ts"),
            // Optional map of transformations.
            transforms: {
                module: (origin, identifier, line, files, aliases) => {
                    // `origin` is the module that an import/export takes place.
                    // `identifier` is the name/path of the import/export.
                    // `line` is the whole line where the import/export occurs.
                    // `files` is an object containing all type definition files and their contents.
                    // `aliases` is an object of aliases from your tsconfig.json file.
                    // Example removing css imports
                    // WARNING: this only works if the import was written on one line.
                    if (identifier.endsWith(".css")) {
                        return "";
                    }
                },
            },
        }),
    ],
};1.4.5
4 years ago
1.4.4
4 years ago
1.4.3
4 years ago
1.4.2
5 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.0
5 years ago
1.2.0
5 years ago
1.1.16
5 years ago
1.1.12
5 years ago
1.1.15
5 years ago
1.1.13
5 years ago
1.1.9
5 years ago
1.1.11
5 years ago
1.1.10
5 years ago
1.1.8
5 years ago
1.1.7
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago