lavas-project / vue-skeleton-webpack-plugin

Lavas webpack plugin: skeleton solution for PWA webshell
886 stars 130 forks source link

After using splitChunks, skeleton dom is not injected into index.html. #92

Open zxs-1024 opened 4 years ago

zxs-1024 commented 4 years ago

Version

vue: v2.6.11 webpack: v4.43.0 node: v11.2.0 vue-skeleton-webpack-plugin: v1.2.2

vue.config.js

const path = require('path')
const SkeletonWebpackPlugin = require('vue-skeleton-webpack-plugin');
const skeletonRouter = require('./src/skeleton/router');

module.exports = {
  lintOnSave: false,
  configureWebpack: {
    plugins: [
      new SkeletonWebpackPlugin({
        webpackConfig: {
          entry: {
            app: path.join(__dirname, './src/skeleton'),
          },
        },
        quiet: true,
        minimize: true,
        router: skeletonRouter,
      })
    ],
    optimization: {
      splitChunks: {
        minSize: 30000,
        maxSize: 102400,
        cacheGroups: {
          common: {
            name: 'common',
            chunks: 'initial',
            minChunks: 2,
            priority: -20,
            reuseExistingChunk: true,
          },
          vendors: {
            test: /[\\/]node_modules[\\/]/,
            name: 'vendors',
            chunks: 'all',
            minChunks: 2,
            priority: -10,
            reuseExistingChunk: true,
          },
        },
      },
    },
  }
}

What is expected?

After using splitChunks, skeleton dom injected into index.html.

What is actually happening?

After using splitChunks, skeleton dom is not injected into index.html.

zxs-1024 commented 4 years ago

The discovery is the reason for using maxsize.