-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
NWJS Version : v0.26.6
Operating System : macOS 10.13.1 (HighSierra)
Now we already can use es6 module features in v0.26.6 (Chrome 62). One example is:
`
-------------lib.js--------------
// lib.js
class TestModule {
foo() {
console.log('---foo----');
}
}
export {TestModule};
-----------testmodule.js----------------
// testmodule.js
import {TestModule} from "./lib.js";
var f = new TestModule();
f.foo();
-----------index.html----------------
<body>
<script type="module" src="testmodule.js"></script>
Hello.
</body>
----------package.json-----------
{
"name": "helloworld",
"main": "index.html",
"dependencies": {}
}
`
The above example can work properly. However, nwjc tool cannot compile them to binary code. The error message is:
`
$/Applications/nwjs/nwjc lib.js lib.bin
Failure compiling 'lib.js' (see above)
`
What's the correct procedure to use es6 module with nwjc? This is important for large scale application.
Thanks.