Hi everybody. Require'ing es6 npm doesn't seem to work for me.
I've released es6 package.
I'm npm install ...ing it but when I try to require it I get:
$ 6to5-node foo.js
SyntaxError: Unexpected reserved word on "import" keyword of that library.
Basically it's not treated as es6.
If I require it directly via ".../my-package/..." it works fine.
Is this a bug or expected behaviour?
node_modules are ignored
To simplify the case:
// ./node_modules/foo.js
let a = "ok"
console.log(a)
// ./foo.js
let a = "ok"
console.log(a)
// test.js
import foo from "./foo" // works fine
import foo from "./node_modules/foo" // doesn't work
one of the first lines in transpiled looks like this for example:
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
aren't things like __esModule 6to5 specific?
babel. Seems more future-proof.
babel or babblejs?