1

Here is my vue.config.js file:

module.exports = {
  configureWebpack: {
    externals: {
      "vue": "Vue",
      "core-js": "core-js",
    },
  },
};

With this config, vue.js (Vue) library is excluded and I can link it from a CDN.

But core-js is packed anyway and not recognized as an external library.

What is wrong with my config?

1 Answer 1

5

You need to change babel config.

Here is my babel.config.js:

module.exports = {
  presets: [
    [
      "@vue/cli-plugin-babel/preset",
      {
        useBuiltIns: false,
      },
    ],
  ],
};

Sign up to request clarification or add additional context in comments.

2 Comments

Found this a while ago. Forgot to post it here. Thanks mate.
Hi, I'm using vue-cli4, it give an error: [BABEL] /Users/rolin/workspace/github/financial_tools_app/src/main.js: Unknown option: .useBuiltIns. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options. - Maybe you meant to use "preset": [ ["@vue/cli-plugin-babel/preset", { "useBuiltIns": false }] ] But the babel formatter always trim quotes, do you know how to fix this error ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.