理论上来说,getVersionController已经废弃,目前只能在config.ts里面用RenamePlugin插件来把资源重命名为crc码结尾的的方式来做版本控制。
部分代码为:
[mw_shl_code=javascript,true]if (command == 'publish') {
const outputDir = `bin-release/web/${version}`;
return {
outputDir,
commands: [
new CleanPlugin({ matchers: ["js","resource"] }),
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
new TextureMergerPlugin(),
new RenamePlugin({
verbose:false,
hash:"crc32",
matchers:[
{from:"resource/*/**",to:"[path][name]_[hash].[ext]"},
]
})]};[/mw_shl_code] |