You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
devtool: "eval" has the best performance, but it only maps to compiled source code per module. In many cases this is good enough. (Hint: combine it with output.pathinfo: true.)
Include comments with information about the modules.
require(/* ./test */23)
Do not use this in production.
Default: false
The UglifyJsPlugin use SourceMaps to map errors to source code. And SourceMaps are slow. As you should only use this in production, this is fine. If your production build is really slow (or doesn’t finish at all) you can disable it with new UglifyJsPlugin({ sourceMap: false }).
UglifyJsPlugin会让 SourceMaps 映射到源码出现错误,速度变慢。所以把UglifyJsPlugin用于生产环境,这是很好的。
如果你生产环境构建很慢(或者玩不成),可以用 new UglifyJsPlugin({ sourceMap: false }). 来禁用sourceMap。
The text was updated successfully, but these errors were encountered:
zhongxia245
changed the title
webpack sourceMap 使用说明
【20160905】webpack sourceMap 使用说明
Sep 5, 2016
webpack sourceMap 使用说明
总结
devtool可选值:
Perfect SourceMaps are slow.
source-map
devtool: "
source-map
" cannot cache SourceMaps for modules and need to regenerate complete SourceMap for the chunk. It’s something for production.eval-source-map
devtool: "
eval-source-map
" is really as good as devtool: "source-map", but can cache SourceMaps for modules. It’s much faster for rebuilds.eval-cheap-module-source-map
devtool: "
eval-cheap-module-source-map
" offers SourceMaps that only maps lines (no column mappings) and are much faster.eval-cheap-source-map
devtool: "
eval-cheap-source-map
" is similar but doesn’t generate SourceMaps for modules (i.e., jsx to js mappings).eval
devtool: "
eval
" has the best performance, but it only maps to compiled source code per module. In many cases this is good enough. (Hint: combine it with output.pathinfo: true.)相关知识
output.pathinfo
Include comments with information about the modules.
Do not use this in production.
The UglifyJsPlugin use SourceMaps to map errors to source code. And SourceMaps are slow. As you should only use this in production, this is fine. If your production build is really slow (or doesn’t finish at all) you can disable it with new UglifyJsPlugin({ sourceMap: false }).
The text was updated successfully, but these errors were encountered: