vue-cli-plugin-multi-compiler

use vue-cli with webpack multi-compiler mode
22,176 12
Install
npm install vue-cli-plugin-multi-compiler
Latest Version:0.1.0
License:MIT
Last Updated:Nov 2, 2018
Links: GitHub  ·  npm
Maintainer: jingkai.zhao

vue-cli-plugin-multi-compiler

Vue CLI 3 plugin to add support for webpack multi-compiler mode

Getting Started

vue add multi-compiler

Configure

This plugin provides a option (configureMultiCompilerWebpack) in vue.config.js to tweak original vue cli webpack config into multiple configs.

You can use either a function or an array:

function usage

module.exports = {
  pluginOptions: {
    configureMultiCompilerWebpack: webpackConfig => {
      // `webpackConfig` here is the one resolved by vue cli.
      // (**after** executing `configureWebpack` and `chainWebpack`)
      const cloneDeep = require('lodash.clonedeep')
      const mainConfig = cloneDeep(webpackConfig)
      const appConfig = cloneDeep(webpackConfig)

      mainConfig.entry = {
        main: './src/main.js'
      }
      appConfig.entry = {
        app: './src/app.js'
      }

      // return an array to invoke webpack multi-compiler mode
      return [mainConfig, appConfig]
    }
  }
}

array usage

module.exports = {
  pluginOptions: {
    configureMultiCompilerWebpack: [
      // configurations here will be merged with original webpack config
      // by `webpack-merge`
      {
        entry: {
          main: './src/main.js'
        }
      },
      {
        entry: {
          app: './src/app.js'
        }
      }
    ]
  }
}

Related Packages

@deppon/create-deppon-app

Vue 3 project scaffold CLI tool

14,622
powerful-cli

封装了webpack功能的命令行接口, 提供serve、build、lib等命令, 支持vue3、js、ts等.....

8,813
vue-just-ssr

Instantly add a Vue SSR dev-env to your repo

1,169 7
vue-cli-plugin-webpack-bundle-analyzer

vue-cli plugin to visualize size of webpack output files

614,353 87
@mingto/mt-cli

明途脚手架工具

2,568
cli

Version History

Version Released License
0.1.0 MIT