Answer the question
In order to leave comments, you need to log in
How to set versions of chunks in vue?
Colleagues, welcome.
How to set versions of chunks in vue?
for example
http://127.0.0.1:3000/js/lang-ru-main-json.js?v=1
http://127.0.0.1:3000/js/lang-ru-main-json.js?v=2
http://127.0.0.1:3000/js/lang-ru-main-json-v0.0.1.js
http://127.0.0.1:3000/js/lang-ru-main-json-v0.0.2.js
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
module.exports = {
devServer: {
host: '0.0.0.0',
public: '0.0.0.0:3000',
disableHostCheck: true
},
parallel: 4,
transpileDependencies: [
'vuetify'
],
productionSourceMap: false,
filenameHashing: true,
pluginOptions: {
webpackBundleAnalyzer: {
openAnalyzer: true
}
},
chainWebpack: config => {
config.plugins.delete('prefetch')
config.plugin('VuetifyLoaderPlugin').tap(args => [{
match (originalTag, { kebabTag, camelTag, path, component }) {
if (kebabTag.startsWith('core-')) {
return [camelTag, `import ${camelTag} from '@/components/core/${camelTag.substring(4)}.vue'`]
}
}
}])
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use('i18n')
.loader('@kazupon/vue-i18n-loader')
},
configureWebpack: config => {
// remove the existing ForkTsCheckerWebpackPlugin
config.plugins = config.plugins.filter(
p => !(p instanceof ForkTsCheckerWebpackPlugin)
)
}
}
Answer the question
In order to leave comments, you need to log in
in the webpack config in the output block:filename: '[name].[contenthash].js',
On our project it is written like this, but using Laravel Mix.
mix.webpackConfig({
output:{
chunkFilename:'js/vuejs_code_split/[name].js?id=[chunkhash]',
},
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question