-
Notifications
You must be signed in to change notification settings - Fork 916
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
[2.0.1] .vue components aren't being transpiled with Babel but other .js files are #374
Comments
Possibly |
I also have this problem |
I was able to get around this by changing my transpiler to Buble with Another potential solution could be to downgrade to Babel 5. It doesn't really matter unless you want to pass the ES6 modules to the bundler for tree shaking or to use |
I also have this problem |
@sqal Good to know but the |
In your config the query only applies to files matched by Use |
laravel-elixir-webpack-official uses buble by default. You can overwrite this however buble will still remain a dependency. vue-loader in the case of when both babel and buble are installed will use buble over babel. It would be nice to be able to configure whether or not vue-loader should use babel over buble, because just because buble is installed doesn't mean I want to use it. Uninstalling buble will not be effective as it will only cause laravel-elixir-webpack-official to complain and as it's a dependency of that, will only be reinstalled. Would this be possible at all? I noticed that regardless of whether or not Buble is installed, vue-loader will use vue-template-es2015-compiler which does use Buble. Is it possible to just switch to Babel? |
@JTallis you can explicitly configure the loader to use: https://vue-loader.vuejs.org/en/configurations/advanced.html |
@yyx990803 Thanks for your reply. It seems that if I specify a Vue loader that it causes issue where my components don't have a template or render function. This may be because it's already defined as a loader inside of the module.exports = {
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
vue: {
loaders: {
js: 'babel-loader'
}
}
} I still have not figured out how it ended up using Babel when I thought I saw it strictly using Buble but at least it's sorted now. :) |
why the webpack bundle file includes a lot of code? such as node-libs-browser |
[edit] This is in my opinion not a
vue-loader
fault but one that affects it and causes bad times nonetheless. Until Babel issue 166 is resolved I propose that this issue be left here. Work arounds are to downgrade to Babel 5 or use Buble transpiler instead.I read that
vue-loader
is capable of finding ifbabel-loader
is being used and that it can pass JS through to Babel within the script tags of the .vue file. I'm learning on Vue starting at 2.0.1 and I have an issue where Babel is not processing my .vue component but it is doing so in my other .js files.Here is my loaders section:
packages.json
Entry:
App.vue:
The text was updated successfully, but these errors were encountered: