1.4.5 • Published 2 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-plugin
Usage
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
2 years ago
1.4.4
2 years ago
1.4.3
3 years ago
1.4.2
3 years ago
1.4.1
3 years ago
1.4.0
4 years ago
1.3.0
4 years ago
1.2.0
4 years ago
1.1.16
4 years ago
1.1.12
4 years ago
1.1.15
4 years ago
1.1.13
4 years ago
1.1.9
4 years ago
1.1.11
4 years ago
1.1.10
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago