Commit a6dd8cb2 by 胡锦波

1. up

parent b72764c4
Showing with 17 additions and 2 deletions
......@@ -31,5 +31,21 @@ module.exports = {
chainWebpack: config => {
config.plugin('lodash').use(webpack.ProvidePlugin, [{ _: 'lodash' }]);
},
configureWebpack: config => {
// 配置别名等放到这里
// 用以解决在chrome sources中vue文件生成带hash而无法找准文件的问题
config.output.devtoolModuleFilenameTemplate = info => {
const resPath = info.resourcePath;
if (
(/\.vue$/.test(resPath) &&
!/type=script/.test(info.identifier)) ||
/node_modules/.test(resPath)
) {
return `webpack:///${resPath}?${info.hash}`;
}
return `webpack:///${resPath.replace("./src", "my-code/src")}`;
};
}
}
\ No newline at end of file
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment