Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification around transpileDependencies #3057

Closed
Aymkdn opened this issue Dec 1, 2018 · 3 comments
Closed

Clarification around transpileDependencies #3057

Aymkdn opened this issue Dec 1, 2018 · 3 comments

Comments

@Aymkdn
Copy link

Aymkdn commented Dec 1, 2018

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 vuetifyjs/vue-cli-plugins#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
@LinusBorg
Copy link
Member

I would rather rate this a bug

@KaelWD
Copy link
Contributor

KaelWD commented Feb 7, 2019

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

@haoqunjiang
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants