Skip to content

transpileDependencies option doesn't work #1552

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

Closed
dirknilius opened this issue Jun 12, 2018 · 6 comments
Closed

transpileDependencies option doesn't work #1552

dirknilius opened this issue Jun 12, 2018 · 6 comments
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author

Comments

@dirknilius
Copy link

Version

3.0.0-beta.16

Reproduction link

https://codesandbox.io/s/1wn0368mv4

Steps to reproduce

Add a package with modern browser syntax and add the transpileDependencies: ["some-package"] option in vue.config.js.

  • Run the codesandbox example in IE 11 -> script error.
  • Look and the source code -> not transpiled.

What is expected?

The given package(s) should be transpiled.

What is actually happening?

The option is ignored.


I have a npm dependency which uses ES6 features and is unfortunately not transpiled. So I added the transpileDependencies: ["vue-moment"] option to my vue.config.js. But the package ist not going to be transpiled. The build version contains all the const and let and spread operator stuff from the original. When I copy the file to the project source and use it all is fine. I also tried transpileDependencies: [/.*/] but not any single package is transpiled.

@yyx990803
Copy link
Member

Sorry but that's not a valid repro since CodeSandbox is not using the latest CLI - please provide an actual repository.

@yyx990803 yyx990803 added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Jun 12, 2018
@dirknilius
Copy link
Author

@yyx990803 I created a new template and could not reproduce this issue. I made a diff with my current project setup and found that I had the babel config in package.json (as created by earlier cli beta). I moved the config to babel.config.js and now it's working. Shouldn't this be equal?

If this is the intended behavior please close this ticket.

@yyx990803
Copy link
Member

Yep, babel.config.js must be used in order for transpileDependencies to work properly. Its behavior is different from .babelrc or babel in package.json.

@jessicarobins
Copy link

@dirknilius how did you get this to actually work?? I'm running into the same issue. Updated all vue cli dependencies to the latest versions and my babel.config.js looks just like one created by the newest version of the cli.

@yyx990803 here is a reproduction repo for you https://github.com/jessicarobins/vue-cli-bug-reproduction can this issue be reopened?

@zhdanovme
Copy link

this can help, vuejs/vue-loader#1411

@FlorianWendelborn
Copy link

FlorianWendelborn commented Nov 1, 2018

@yyx990803 This should be added as a huge warning on the vue-cli docs. Perhaps, even vue-cli should warn when starting the app?

EDIT: The workaround of having yet another dotfile worked in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author
Projects
None yet
Development

No branches or pull requests

5 participants