Home

Issue: 211

Set up Babel for non-client code

[issue link]

It’s a bit surprising to me that I can’t use import in server.js from the example Express bundle. require can get a bit clunky if I want to pull multiple definitions from a single module. Granted, Node 7 supports lots of Es2015, but the modules system is an exception.

I tried adding babel-core/babel-register and including a .babelrc, but that didn’t seem to touch the files pulled in by the Nuxt commands, possibly because they’re in node_modules and node_modules is exempt from babel-register.

Any chance we might gain the ability to use the same ES2015 code and features on both the client and server? Thanks!

This question is available on Nuxt.js community (#c183)