1.0.2 • Published 5 years ago

vue-mpa-skeleton-plugin v1.0.2

Weekly downloads
4
License
MIT
Repository
-
Last release
5 years ago

vue-mpa-skeleton-plugin

针对 Vue mpa(多页应用) 生成骨架屏的 webpack 插件。各个页面的骨架屏可单独进行定制开发

核心依赖mpa(多页应用)

vue-server-renderer

具体参考 vue 服务端渲染官网, https://ssr.vuejs.org/zh/

使用方法

安装:

npm install vue-mpa-skeleton-plugin

在 webpack 中引入插件:

plugins: [
    new VueMpaSkeletonPlugin({
        webpackConfig: {
            entry: {
                app: resolve('./src/entry-skeleton.js')
            }
        }
    })
]

注:entry通常需要赋值成Object类型的变量

压缩注入的 HTML 和 CSS

new HtmlWebpackPlugin({
        title: enableDll ? '模板文件hasDll' : '模板文件',
        filename,
        chunks,
        template,
        //+++
        minify: {
          removeComments: true,
          collapseWhitespace: true,
          removeAttributeQuotes: true,
          minifyCSS: true // 压缩内联的 CSS
        }
        //+++
      })