-
Notifications
You must be signed in to change notification settings - Fork 47
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
Not working with WebPack 2 beta #14
Comments
@sudsy Hey there, I think what is happening here is that you are perhaps trying to inject before you’ve transformed the code. This would mean that is you are writing code using es6 modules (as above), they are going to be moved inside the closure for injection — which as the error is indicating — is not allowed. Please try running inject after and code transformations (e.g babel), and feel free to re-open if you’re still having issues. 👍 |
Hi Justin, I'm not using babel at all. I'm using the native es6 module support from I can't see how I can run the loader after the native transformations. Sudsy On Sat, 3 Sep 2016, 14:30 Justin Morris notifications@github.com wrote:
|
Ahh, OK — I see. I’m not sure if I can support that use-case, at the moment only injecting CJS deps is supported. I’ll try and see if I can come up with an alternative. |
@plasticine is there any movement on this use case, I'd also be interested in this, and would be happy to collaborate on a PR if we could figure out a strategy that works. |
@stayman No movement as such — no. To be honest I can’t see that it’s possible to support this use-case. The whole premise of For code under test I would suggest that you transform these imports to CJS style in order to use Most definitely open to other ideas, but as far as I can see that’s kinda where we’re at... |
./~/inject-loader!../src/pages/calculators/module-ray-tracer/calc-module-ray-tracer/turboSimJobManager.js
Module parse failed: C:\Users\sudsy\Development\gen3\PVL.Content\tests\node_modules\inject-loader\index.js!C:\Users\sudsy\Development\gen3\PVL.Content\src\pages\calculators\module-ray-tracer\calc-module-ray-tracer\turboSimJobManager.js 'import' and 'export' may only appear at the top level (4:0)
You may need an appropriate loader to handle this file type.
| var module = {exports: {}};
| var exports = module.exports;
| import {Observable} from 'rxjs/Observable';
| import auth from "authentication";
| import connMgr from "modules/connection-manager/connection-manager";
@ ./unit-mocha/modules/SimJobManager/testTurboSimJobManager.js 3:0-110
@ ./unit-mocha/modules/SimJobManager/testTurboSimJobManager.js
@ multi main
The text was updated successfully, but these errors were encountered: