We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
构建 umd 的命令:vue-cli-service build --target lib --inline-vue --name subapp ./src/main.js ,发现生成的umd.js文件不带hash,尝试在vue.config.js中配置hash: configureWebpack: { output: { // 在文件名中添加哈希 filename: '[name].js', chunkFilename: '[name].[hash].js' } } 但是上面打包后文件名并没带hash。 深入查看打包源码,发现:node_modules@vue\cli-service\lib\commands\build\resolveLibConfig.js文件中: rawConfig.output = Object.assign({ library: libName, libraryExport: isVueEntry ? 'default' : undefined, libraryTarget: format, // preserve UDM header from webpack 3 until webpack provides either // libraryTarget: 'esm' or target: 'universal' // webpack/webpack#6522 // webpack/webpack#6525 globalObject: (typeof self !== 'undefined' ? self : this) }, rawConfig.output, { filename: ${entryName}.js, chunkFilename: ${entryName}.[name].js, // use dynamic publicPath so this can be deployed anywhere // the actual path will be determined at runtime by checking // document.currentScript.src. publicPath: '' }) 外部配置的chunkFilename已经被写死覆盖了。
(typeof self !== 'undefined' ? self : this)
${entryName}.js
${entryName}.[name].js
The text was updated successfully, but these errors were encountered:
No branches or pull requests
构建 umd 的命令:vue-cli-service build --target lib --inline-vue --name subapp ./src/main.js ,发现生成的umd.js文件不带hash,尝试在vue.config.js中配置hash:
configureWebpack: {
output: {
// 在文件名中添加哈希
filename: '[name].js',
chunkFilename: '[name].[hash].js'
}
}
但是上面打包后文件名并没带hash。
深入查看打包源码,发现:node_modules@vue\cli-service\lib\commands\build\resolveLibConfig.js文件中:
rawConfig.output = Object.assign({
library: libName,
libraryExport: isVueEntry ? 'default' : undefined,
libraryTarget: format,
// preserve UDM header from webpack 3 until webpack provides either
// libraryTarget: 'esm' or target: 'universal'
// webpack/webpack#6522
// webpack/webpack#6525
globalObject:
(typeof self !== 'undefined' ? self : this)
}, rawConfig.output, {
filename:
${entryName}.js
,chunkFilename:
${entryName}.[name].js
,// use dynamic publicPath so this can be deployed anywhere
// the actual path will be determined at runtime by checking
// document.currentScript.src.
publicPath: ''
})
外部配置的chunkFilename已经被写死覆盖了。
The text was updated successfully, but these errors were encountered: