How can a Vue CLI plugin modify transpileDepencies?

69 Views Asked by At

How can my Vue CLI plugin tell babel CLI plugin that a certain dependency in node_modules has to be transpiled?

Even this brute-force attempt failed, though theoretically all files should be transpiled:

module.exports = (api, opts) => {
  api.chainWebpack(config => {
    config.module.rules.get('js').exclude.add(_ => false)

But replacing false with true did produce expected results, meaning no files were transpiled.

I suppose the challenge is limited to js files, since vue files are always transpiled by cli-plugin-babel: https://github.com/vuejs/vue-cli/blob/master/packages/@vue/cli-plugin-babel/index.js#L39

0

There are 0 best solutions below