作者:persisit110 | 来源:互联网 | 2022-12-02 18:02
我正在使用webpack捆绑我的打字稿nodejs代码。
我webpack-node-externals
用来避免在编译期间在node_modules中出错。
webpack-node-externals
说,允许您定义外部-不应该捆绑的模块。
但为什么?Webpack应该捆绑我开始捆绑所需的一切,对吗?它可以提取并删除我不使用的模块。(例如,摇树)。
If I use webpack-node-externals
, then I'll have to do npm i
in my prod folder to get all the dependencies.
I think this is miss the point of webpack can do. right?