Closed
Description
In the main README.md, it states:
By default the generated JS uses ES modules and is compatible with both Node and browsers (but will likely require a bundler for both use cases).
But it seems like the ES module can't be consumed by node directly. Like I can't do this:
const myLib = require('myLib')
const sum = myLib.add(1, 2)
console.log(sum)
However the --nodejs
flag for the compiler allows this to work seamlessly. Do we need to use webpack for both browser setup and node setup with the default es6 modules?
Ideally, it would be fine if the default usage in the browser would need webpack, but what is the ideal build setup for using it in nodejs without webpack?