cheap-module-source-map是生产环境的最佳实践?

来源:3-7 SourceMap 的配置

鸣人与路飞

2019-04-13

根据文档,cheap-module-source-map 对 production和development都是不适合的。跟老师推荐的方法不一致。

Special cases
The following options are not ideal for development nor production. They are needed for some special cases, i. e. for some 3rd party tools.

inline-source-map - A SourceMap is added as a DataUrl to the bundle.

cheap-source-map - A SourceMap without column-mappings ignoring loader Source Maps.

inline-cheap-source-map - Similar to cheap-source-map but SourceMap is added as a DataUrl to the bundle.

cheap-module-source-map - A SourceMap without column-mappings that simplifies loader Source Maps to a single mapping per line.

inline-cheap-module-source-map - Similar to cheap-module-source-map but SourceMap is added as a DataUrl to the bundle.

写回答

1回答

Dell

2019-04-13

生产环境其实我觉得无所谓了,只会影响一个打包速度。这个只会在上线过程中处理一次,所以看你需要,你如果经常线上调试bug,直接用source-map都可以,如果你不线上调试,那根本都不需要使用。

1
0

从基础到实战 手把手带你掌握新版Webpack4.0

知识点+项目实例+原理讲解 全方位解析Webpack4新版本

3627 学习 · 1291 问题

查看课程