Webpack plugin used to integrate typed-directory module.
npm install --save-dev typed-directory typed-directory-webpack-plugin
// webpack.config.js
const TypedDirectoryWebpackPlugin = require("typed-directory-webpack-plugin");
const path = require("path");
module.exports = {
entry: "./src/main.ts",
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js"
},
module: {
rules: [
{
test: /\.ts$/,
loader: "awesome-typescript-loader"
}
]
},
resolve: {
extensions: [ ".ts", ".js" ]
},
plugins: [
// No arguments so use default config file
new TypedDirectoryWebpackPlugin()
]
}
The plugin use the same parameters as the plain typed-directory
module.
See the original module documentation to know how to use it.
The tests can be run by using the test command:
npm run test
Coverage data can also be generated by running the coverage command:
npm run coverage
To view the coverage report, open coverage/lcov-report/index.html
in the browser of your choice.