A webpack plugin that improves tree-shaking by performing deep scope analysis to eliminate unused imports related to unused exports. Version 1.6.2 requires webpack ^4.14.0 and Node.js 8+. It solves webpack issue #6264 by analyzing variable scopes and removing dead code more aggressively than standard tree-shaking. Uses TypeScript and includes a custom version of escope. Alternative to webpack's built-in sideEffects flag but only works with ES module syntax (import/export).
npm install webpack-deep-scope-pluginVerified import paths — ran on the pinned version, not inferred.
Shows how to add the plugin to webpack config with CommonJS require and usedExports optimization.
Ensure your code uses ES modules; avoid Babel transforming to CommonJS unless targeting Node.
Update references if directly using deep-scope-analyser; plugin API remains same.
Use webpack 4.x or find alternative for webpack 5 (e.g., webpack's built-in sideEffects flag).
Consider using webpack 5's built-in tree-shaking or sideEffects in package.json.
Import via require('webpack-deep-scope-plugin').defaultRun npm install deep-scope-analyser
Ignore the warning if tree-shaking works; or try using webpack 4.43+ which may reduce warnings.
No dependency data recorded yet.