我正在使用CommonsChunkPlugin让我的供应商和polyfills文件与我的所有模块共享。我相信我的供应商模块中有一个错误。如何确保我的供应商文件不会缩小?所以,我可以在里面进行调试。非常感谢。
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
config.entry = {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'app': './src/main.ts' // our angular app
};
config.output = {
path: root('dist'),
publicPath: isProd ? '/wwwroot/' : 'http://localhost:8080/',
filename: isProd ? 'js/[name].[hash].js' : 'js/[name].js',
chunkFilename: isProd ? '[id].[hash].chunk.js' : '[id].chunk.js'
};
config.plugins.push(
new CommonsChunkPlugin({
name: ['vendor', 'polyfills']
})
);发布于 2017-06-22 16:27:38
你没有提到你正在使用TypeScript!
看,这里有一整篇关于React & Webpack的文章,官方文档:https://www.typescriptlang.org/docs/handbook/react-&-webpack.html
你可以跳过关于react的部分,你可以只专注于源地图的事情!基本上,您的tsconfig.json中缺少source-map-loader和配置
https://stackoverflow.com/questions/44633394
复制相似问题