1.0.1 • Published 2 years ago

@pockpock/vue-cli-plugin-dll v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vue-cli-plugin-dll vue-cli3 npm npm

This is a vue-cli 3.x plugin for webpack Dll-Plugin that can drastically improve build time performance. vue-cli-plugin-dll plugin register dll instruction to avoid adding extra webpack config file, it also insert DllReferencePlugin and inject chunk files automatically when you run dev/build directives.

English | 中文

Quick Start

Make sure you have the vue-cli 3.x.x version installed

$ vue -V

Install plugin

$ vue add dll

# OR

$vue invoke dll

Simple configuration

// vue.config.js

 module.exports = {
    pluginOptions: {
        dll: {
            entry: ['vue', 'vue-router'],
            cacheFilePath: path.resolve(__dirname, './public')
        }
    }
 }

Execution

$ npm run dll

#OR

$ npx vue-cli-service dll

Configuration

Options

ParameTypeDescriptionDefaultRequired
entryObject/Array/Stringentry vendornulltrue
openBooleanwhether to add DllReferencePlugin plugintruefalse
outputObjectoutputfalse
output.pathStringThe output directory as an absolute path'yourProjectPath/public/dll'false
output.publicPathSrtingpublicPath''false
injectBooleanauto inject file to index.htmltruefalse
cacheFilePathStringThe path that save vender path'yourProjectPath/node_modules/vue-cli-plugin-dll/src'false

vue.config.js

module.exports = {
  // Other options...

  pluginOptions: {
     dll: {
      entry: ['vue'],

      /**
       * the directory path where the vendor files will be generated in 
       * when running vue-cli-service dll
       */
      output: path.join(__dirname, './public/dll'),

      // If you only want to open `dll plugin` during production build, 
      // you can use the following config:
      open: process.env.NODE_ENV === 'production',

      // !! Recommended configuration
      cacheFilePath: path.resolve(__dirname, './public')
    }
  }
}

License

MIT