Vue-cli: ERROR Invalid options in vue.config.js: "externals" is not allowed

Created on 24 Sep 2019  路  1Comment  路  Source: vuejs/vue-cli

Version

3.11.0

Reproduction link

no

Environment info

Environment Info:

  System:
    OS: macOS 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 10.16.2 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.11.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 77.0.3865.90
    Firefox: Not Found
    Safari: 13.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.0.0
    @vue/babel-preset-app:  3.11.0
    @vue/babel-preset-jsx:  1.1.0
    @vue/babel-sugar-functional-vue:  1.0.0
    @vue/babel-sugar-inject-h:  1.0.0
    @vue/babel-sugar-v-model:  1.0.0
    @vue/babel-sugar-v-on:  1.1.0
    @vue/cli-overlay:  3.11.0
    @vue/cli-plugin-babel: ^3.11.0 => 3.11.0
    @vue/cli-plugin-eslint: ^3.11.0 => 3.11.0
    @vue/cli-service: ^3.11.0 => 3.11.0
    @vue/cli-shared-utils:  3.11.0
    @vue/component-compiler-utils:  3.0.0
    @vue/preload-webpack-plugin:  1.1.1
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.3 (4.7.1)
    vue: ^2.6.10 => 2.6.10
    vue-eslint-parser:  2.0.3 (5.0.0)
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.7.1
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: 3.11.0

Steps to reproduce

  1. config vue.config.js with externals: ['vue', 'axios']
  2. run vue-cli-service build --target lib --name index ./src/index.js
  3. ERROR Invalid options in vue.config.js: "externals" is not allowed

What is expected?

i want my library doesn't contain axios or vue

What is actually happening?

ERROR Invalid options in vue.config.js: "externals" is not allowed

Most helpful comment

externals is a webpack config option, not a Vue CLI one.
So, it should be: configureWebpack: { externals: ['vue', 'axios'] }

>All comments

externals is a webpack config option, not a Vue CLI one.
So, it should be: configureWebpack: { externals: ['vue', 'axios'] }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DrSensor picture DrSensor  路  3Comments

chasegiunta picture chasegiunta  路  3Comments

Gonzalo2683 picture Gonzalo2683  路  3Comments

jgribonvald picture jgribonvald  路  3Comments

sanderswang picture sanderswang  路  3Comments