-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build output files overwritten by Terser Plugin if comments extract enabled #148
Labels
Comments
这个问题遇到过,开始的考虑是保留LICENSE的文件输出,但用户可以选择上传的文件中过滤掉LICENSE,既然有争议,可以去掉这个配置 |
[name]-[hash].js可以吗 |
[name]-[hash].js 的形式,文件不好引用 |
module.exports = {
assetWithHash(asset) {
// 读取配置中的manifest
const manifest = this.app.config.manifest || {};
// 映射文件名
let filename = asset;
if (manifest[asset]) {
filename = manifest[asset];
return filename;
}
return this.helper.asset(filename);
},
}; 感觉利用ManifestPlugin const ManifestPlugin = require('webpack-manifest-plugin');
factory.addPlugin(ManifestPlugin, { fileName: '../manifest.json' }, 'WebpackManifestPlugin'); 顺便解决 #55 |
@ahungrynoob 这个可以作为新feature开发,当前这是个bug,先默认关闭 extractComments 修复掉 |
哦哦 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
beidou/packages/beidou-webpack/config/config.default.js
Line 15 in 21c1f66
If comments extract enabled,comments will be extracted to separated files with suffix
. LICENSE
。With the default configuration of Beidou, which will leads to
[name].js?[hash].LICENSE
, reference to the same file, may cause source files overwritten by LICENSE files.The text was updated successfully, but these errors were encountered: