Vue-cli: Clarification around transpileDependencies

Created on 1 Dec 2018  路  3Comments  路  Source: vuejs/vue-cli

What problem does this feature solve?

transpileDependencies searches for the provided terms in the full path, meaning that if we have something like transpileDependencies: ['vuetify'] (see https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues/55) then any vuetify in the path will cause Babel to translate the files.

For example, if my path is /home/aymkdn/projects/vuetify/my-app/, EVERYTHING is compiled, causing multiple errors. Even if the path is /home/aymkdn/projects/my-app/ Babel will translate all node modules with "vuetify" in their name (like vue-cli-plugin-vuetify or vuetify-loader)

The expected behavior when reading the documentation is to only compile the module called "vuetify"

What does the proposed API look like?

I see three options here :

  1. Clarify the documentation to explain that this option will search for the terms in the whole path
  2. Change transpileDependencies to only look at node module names (for example transpileDependencies: ['vuetify'] will be equivalent to /home/aymkdn/projects/vuetify/my-app/node_modules/vuetify/)
  3. Add a new parameter, called transpileModules that will do the same as option 2 above
bug has PR cli-service build

All 3 comments

I would rather rate this a bug

Does that fix work if node_modules is above the project folder, like in a monorepo?

@KaelWD I think so. That fix is essentially changing the regexp from vuetify to node_modules/vuetify.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DrSensor picture DrSensor  路  3Comments

chasegiunta picture chasegiunta  路  3Comments

eladcandroid picture eladcandroid  路  3Comments

Akryum picture Akryum  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments