We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If importing the default object of .js file in a .vue file, the default object will be wrapped.
.js
.vue
foo.js
export default { bar: 123 };
some.vue
import foo from './foo'; // need to use foo.default to access the default object console.log(foo.default.bar);
I think the problem is because vue-loader did not config the babel option: modules: false at https://github.com/nuxt/nuxt.js/blob/master/lib/build/webpack/vue-loader.config.js#L7
vue-loader
modules: false
let config = { postcss: this.options.build.postcss, loaders: { 'js': 'babel-loader?presets[]=es2015&presets[]=stage-2', 'less': 'vue-style-loader!css-loader!less-loader', 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax', 'scss': 'vue-style-loader!css-loader!sass-loader', 'stylus': 'vue-style-loader!css-loader!stylus-loader', 'styl': 'vue-style-loader!css-loader!stylus-loader' } }
I wonder why set the babel options here rather than use the .babelrc ?
The text was updated successfully, but these errors were encountered:
Hi @fenivana
Thanks for spotting it, it will be fixed in the next release 👍
Sorry, something went wrong.
Fixed in 0.9.0
0.9.0
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Atinux
No branches or pull requests
If importing the default object of
.js
file in a.vue
file, the default object will be wrapped.foo.js
some.vue
I think the problem is because
vue-loader
did not config the babel option:modules: false
at https://github.com/nuxt/nuxt.js/blob/master/lib/build/webpack/vue-loader.config.js#L7I wonder why set the babel options here rather than use the .babelrc ?
The text was updated successfully, but these errors were encountered: