Skip to content

Commit

Permalink
feat: 本地开发时js文件输出sourcemap
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongzhi107 committed Dec 9, 2019
1 parent 0172f93 commit e25c622
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/webpack/config/createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default ({
mode: IS_DEV ? 'development' : 'production',
context: process.cwd(),
target,
devtool: IS_DEV ? 'none' : 'cheap-module-source-map',
devtool: 'none',
resolve: {
modules: ['node_modules', DACE_PATH_NODE_MODULES].concat((NODE_PATH).split(path.delimiter).filter(Boolean)),
extensions: ['.js', '.jsx'],
Expand Down Expand Up @@ -450,6 +450,7 @@ export default ({
};

if (IS_DEV) {
config.devtool = 'cheap-module-source-map';
config.entry.unshift(require.resolve('../../utils/webpackHotDevClient'));

// Configure our client bundles output. Not the public path is to 3001.
Expand Down Expand Up @@ -570,7 +571,7 @@ export default ({

// 项目中的配置文件优先级最高
if (modify) {
config = modify(config, { target, isDev: IS_DEV }, webpack);
config = modify(config, { target, isDev }, webpack);
}

return config;
Expand Down

0 comments on commit e25c622

Please sign in to comment.