Attempting to destructure from the export default statement will result in undefined values. All works as expected if I run the code without compiling with isparta (notice I'm importing second.js not second-compiled.js:
import all, {stuff, things} from './second';
import {reactor} from '../lib/modules/bootstrap.js';
console.log('**DEFAULT**', all);
console.log('***DESTRUCTURED***', stuff, things);
Curious if this is a bug or if Babel is letting me get away with stuff I shouldn't be able to? I noticed if I export something that is not default out of the file I will get similar output to isparta when I just run it with babel
This is a problem because I have a big application that I am doing various destructuring off of export default and it chokes when I'm running it with isparta/karma/webpack
UPDATE
NVM, I believe my problem is that I'm still on Babel 5 for my project (because it is using babel plugins that have not yet been updated), but was using Isparta with Babel 6. It seems that Babel 6 is enforcing this syntax more strongly now http://stackoverflow.com/questions/33524696/es6-destructuring-and-module-imports.
If I have the following structure
And I compile
first.js
andsecond.js
withisparta
instrumenter APIAttempting to destructure from the
export default
statement will result inundefined
values. All works as expected if I run the code without compiling withisparta
(notice I'mimport
ingsecond.js
notsecond-compiled.js
:Curious if this is a bug or if Babel is letting me get away with stuff I shouldn't be able to? I noticed if I export something that is not default out of the file I will get similar output to
isparta
when I just run it with babelThis is a problem because I have a big application that I am doing various destructuring off of
export default
and it chokes when I'm running it with isparta/karma/webpackUPDATE
NVM, I believe my problem is that I'm still on Babel 5 for my project (because it is using babel plugins that have not yet been updated), but was using Isparta with Babel 6. It seems that Babel 6 is enforcing this syntax more strongly now http://stackoverflow.com/questions/33524696/es6-destructuring-and-module-imports.
Hopefully, to save others time in the future you can use this plugin to restore the old behavior https://www.npmjs.com/package/babel-plugin-add-module-exports http://stackoverflow.com/questions/33505992/babel-6-changes-how-it-exports-default