vue 增加/刪除版本號
在開發(fā)項目的過程中啊易,可能我們不大想要打包之后的一大串后綴韩脑,這時候我們就可以在 webpack.prod.conf.js這個文件里把版本號去掉超凳,這樣打包之后的文件就顯得簡單明了
面臨的問題:沒有了版本號的控制婆硬,在我們重新發(fā)布新版本的時候宰啦,本地可能會有緩存現(xiàn)象苏遥,特別是微信端,緩存現(xiàn)象尤其突出赡模,無論你怎樣清理緩存田炭,發(fā)現(xiàn)緩存現(xiàn)象依然存在,于是你迫不得已漓柑,忍痛割愛教硫,只好默默的卸掉微信重新安裝
文件路徑: /build/webpack.prod.conf.js
output:{
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
}
plugins: [
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[chunkhash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
]