async addSkeletonPlugin(spaConfig) {
        let {router, skeleton} = this.config;
        // if skeleton provided, we need to create an entry
        let skeletonConfig;

        // add default skeleton path `@/core/Skeleton.vue`
        if (!skeleton.routes || !skeleton.routes.length) {
            skeleton.routes = [{
                path: '*',
                componentPath: DEFAULT_SKELETON_PATH
            }];
        }

        // check if all the componentPaths are existed first
        let error = await this.validateSkeletonRoutes(skeleton.routes, spaConfig.resolve.alias.entries());
        if (error && error.msg) {
            console.error(error.msg);
        }
        else {
            // generate skeletonId based on componentPath
            skeleton.routes.forEach(route => {
                route.componentName = basename(route.componentPath, '.vue');
                route.componentNameInDash = camelCaseToDash(route.componentName);
                route.skeletonId = route.skeletonId || route.componentNameInDash;
            });

            // marked as supported at this time
            this.skeletonEnabled = true;

            let skeletonEntryPath = await this.writeSkeletonEntry(skeleton.routes);

            // when ssr skeleton, we need to extract css from js
            skeletonConfig = await this.webpackConfig.server({
                cssExtract: true,
                extendWithWebpackChain: (serverConfig, {type}) => {
                    if (type === 'server') {
                        serverConfig.entry(DEFAULT_ENTRY_NAME).add(skeletonEntryPath);
                        // remove some plugins
                        serverConfig.plugins
                            .delete('ssr-server')
                            .delete('progress-bar')
                            .delete('progress')
                            .delete('friendly-error');
                    }
                }
            });

            // add skeleton plugin
            spaConfig.plugin('skeleton').use(SkeletonWebpackPlugin, [{
                webpackConfig: skeletonConfig,
                quiet: true,
                router: {
                    mode: router.mode,
                    routes: skeleton.routes
                },
                minimize: !this.isDev
            }]);
        }
    }
use vue-skeleton-webpack-plugin

@param {Object} spaConfig spaConfig