Using ES6 with npm today
mammal.io
Using ES6 with npm today
1–8 of 8 posts
Re: Using ES6 with npm today
#2Re: Using ES6 with npm today
#3The last part is missing : how should non-ES6 Node scripts require the ES6 components ?
The real fun part is going the other direction: using non-ES6 modules inside ES6 code. Using 6to5ify (now babelify), I had the issue that I couldn't access the `exports` variable, only properties on it.
Re: Using ES6 with npm today
#4The last part is missing : how should non-ES6 Node scripts require the ES6 components ?
The transpilers will compile the module into an object you can require normally. The default export is under { "default": ... } and the other exported properties are under their exported names. The real fun part is going the other direction: using non-ES6 modules inside ES6 code. Using 6to5ify (now babelify), I had the issue that I couldn't access the `exports` variable, only properties on it.
Re: Using ES6 with npm today
#5The last part is missing : how should non-ES6 Node scripts require the ES6 components ?
Re: Using ES6 with npm today
#6The last part is missing : how should non-ES6 Node scripts require the ES6 components ?
babel --modules common -d lib/ src/
Re: Using ES6 with npm today
#7The last part is missing : how should non-ES6 Node scripts require the ES6 components ?
They should simply use standard node js require. The author forgot to specify common js interop option in babel. babel --modules common -d lib/ src/