Disable language chunks to fix build issues

We don't need to prefetch all the languages on every page load, but there are currently some issues with modifying webpack plugin configs when using the --modern build option.
This commit is contained in:
Matt Isenhower 2018-07-31 14:10:05 -07:00
parent 3cfec6d8f2
commit 44bc51f0a0
2 changed files with 13 additions and 9 deletions

View File

@ -1,6 +1,9 @@
export default {
loadLocale({ dispatch }, locale) {
import(/* webpackChunkName: "lang-[request]" */ `@/web/locale/${locale}`)
.then(translations => dispatch('addLocale', { locale, translations: translations.default }));
// Disabling this for now due to issues with disabling prefetching with the modern build (see vue.config.js)
// import(/* webpackChunkName: "lang-[request]" */ `@/web/locale/${locale}`)
// .then(translations => dispatch('addLocale', { locale, translations: translations.default }));
dispatch('addLocale', { locale, translations: require(`@/web/locale/${locale}`) });
}
}

View File

@ -43,13 +43,14 @@ module.exports = {
}),
]
},
chainWebpack: config => {
config.plugin('prefetch-index').tap(options => {
options[0].fileBlacklist = options[0].fileBlacklist || [];
options[0].fileBlacklist.push(/lang-.+?\.js$/);
return options;
});
},
// Disabling this for now due to issues with the modern build
// chainWebpack: config => {
// config.plugin('prefetch-index').tap(options => {
// options[0].fileBlacklist = options[0].fileBlacklist || [];
// options[0].fileBlacklist.push(/lang-.+?\.js$/);
// return options;
// });
// },
devServer: {
contentBase: [
'./public',