webpack-assert-tree-shaking-plugin
A webpack plugin that asserts the specified files are tree shaken
Install
npm install -D webpack-assert-tree-shaking-plugin
yarn add -D webpack-assert-tree-shaking-plugin
Usage
In your webpack.config.js
,
const WebpackAssertTreeShakingPlugin = ; moduleexports = /* your configuration */ plugins: /* other plugins */ // Specify a module path that should be tree shaken modulePath: A_FILE_PATH_TO_BE_TREE_SHAKEN modulePath: A_FILE_PATH_TO_BE_TREE_SHAKEN // You can also specify variable names that should be tree shaken values: 'A_EXPORTED_VARIABLE_NAME_TO_BE_TREE_SHAKEN' /* ... */ ;