splitted chunks for vue router pages, materialdesignicons styles

This commit is contained in:
2021-04-06 12:31:31 +02:00
parent b8cdc2d64b
commit b4b51e3a41
20 changed files with 142 additions and 43 deletions

View File

@@ -25,11 +25,13 @@ module.exports = {
'main': utils.resolve(themePath + '/assets/scripts/main.js'),
// 'lang-en': utils.resolve(langPath + '/en.json'),
'print': utils.resolve(themePath + '/assets/styles/print.scss')
// 'mdi': utils.resolve(themePath + '/assets/styles/mdi/scss/materialdesignicons.scss')
},
output: {
publicPath: '/themes/custom/materiotheme/assets/dist/',
path: utils.resolve(themePath + '/assets/dist/'),
filename: '[name].js',
chunkFilename: '[name].js'
chunkFilename: '[name].bundle.js'
},
module: {
rules: [
@@ -52,12 +54,12 @@ module.exports = {
// type: 'javascript/auto',
// loader: '@kazupon/vue-i18n-loader'
// },
{
test: /\.js$/,
use: {
loader: 'babel-loader',
}
},
// {
// test: /\.js$/,
// use: {
// loader: 'babel-loader',
// }
// },
{
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
@@ -115,18 +117,23 @@ module.exports = {
optimization: {
splitChunks: {
cacheGroups: {
vsa: {
test: /[\\/]node_modules[\\/](vue-simple-accordion)[\\/]/,
name: 'vsa',
chunks: 'all',
usedExports: true
},
// vsa: {
// test: /[\\/]node_modules[\\/](vue-simple-accordion)[\\/]/,
// name: 'vsa',
// chunks: 'all',
// usedExports: true
// },
vclb: {
test: /[\\/]node_modules[\\/](vue-cool-lightbox)[\\/]/,
name: 'vclb',
chunks: 'all',
usedExports: true
},
// vue_page_article: {
// test: /[\\/]web[\\/]themes[\\/]custom[\\/]materiotheme[\\/]vuejs[\\/]components[\\/]Pages[\\/]Article.vue/,
// name: 'vue_page_article',
// chunks: 'all'
// }
},
},
},