Afshin Gh
Afshin Gh

Reputation: 8198

vue.js: exclude core-js from webpack

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?

Upvotes: 1

Views: 1740

Answers (1)

iolo
iolo

Reputation: 1167

You need to change babel config.

Here is my babel.config.js:

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

Upvotes: 5

Related Questions