vuejs / vueify

Browserify transform for single-file Vue components
MIT License
1.17k stars 152 forks source link

The mere presence of babel-core in node_modules alters the behavior of Vueify #164

Open teleclimber opened 7 years ago

teleclimber commented 7 years ago

If I have babel-core in my project's node_modules then Vueify will compile my Vue files down from es2015. If I remove babel-core, then Vueify quietly changes its behavior and nothing gets compiled. I get no indications or warnings about this change.

First, it's weird that the behavior of this module is dependent on the presence of a module in the project. Should this not be a configuration option? Then, if a module is missing for the desired configuration throw an error, but just changing behavior silently because a module is present or missing is not dev-friendly.

Given how Babel is so widely used, that module could be present for any number of reasons. Just because it's there doesn't mean I want my .vue files compiled. How do I disable this behavior if I need babel-core in my project for other reasons?

Thanks.

LinusBorg commented 7 years ago

First and foremost, this behavior is described in the README, so it shouldn't be surprising.

Now, about how to deactivate it: I have actually never tried it. Two things I could think of would be to pass options to the babel property of vueify that define empty plugins and presets arrays. That would not keep babel from running on the .vue files, but nothing would be transpiled.

The other would be to exclude .vue files from being converted through defining ignore: /\.vue$/ in the .babelrc file - but honestly I doubt whether that would work because vueify does not actually pass the file paths to babel I think.