webpack-assert-tree-shaking-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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 } = require('webpack-assert-tree-shaking-plugin');
 
module.exports = {
    /* your configuration */
 
    plugins: [
        /* other plugins */
 
        new WebpackAssertTreeShakingPlugin([
            {
                // 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' /* ... */],
            },
        ]),
    ],
};

Readme

Keywords

none

Package Sidebar

Install

npm i webpack-assert-tree-shaking-plugin

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

18.4 kB

Total Files

8

Last publish

Collaborators

  • shqld