Socket
Socket
Sign inDemoInstall

vue-cli-plugin-multi-compiler

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-cli-plugin-multi-compiler

use vue-cli with webpack multi-compiler mode


Version published
Weekly downloads
809
increased by2.8%
Maintainers
1
Install size
1.40 MB
Created
Weekly downloads
 

Readme

Source

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'
        }
      }
    ]
  }
}

Keywords

FAQs

Last updated on 30 Oct 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc