I have a problem in treeshaking. It seems like it is not too effective on my project. Is there a way to see a list of the dependencies that is actually used in my webpacked file?
Webpack config:
entry: sourceEntryFile,
mode: 'production', // for webpack 4
target: 'node',
output: {
filename: '[name].js',
path: outputPathFolder,
libraryTarget: 'commonjs',
},
resolve: {
extensions: ['.js', '.json'],
modules: ['node_modules']
},
node: {
__dirname: false,
},
externals: {
'aws-sdk': 'aws-sdk'
},
plugins: (() => {
const plugins = [
new webpack.DefinePlugin({
'global.GENTLY': false
})
];
// plugins.push(new WebpackBundleAnalyzer.BundleAnalyzerPlugin());
return plugins;
})()
npm ls
seems to be the closest one. The results show which modules are being used in current project.