Hacker News new | ask | show | jobs
by dvcc 3450 days ago
Doesn't this have more to do with Babel and less to do with Webpack? I think this originates with how Babel treats ES6 Modules differently from CommonJS, and if you were to instead do:

  const foo = require('./bar').foo
it would keep the name the same?

EDIT: https://github.com/jamietre/babel-plugin-transform-es2015-mo...

There is a better explanation with a partial solution.

2 comments

Typescript doesn't need babel since the typescript compiler supports es6.
The 'let' should have made me re-think the problem.
I don't think Babel is the cause, not in this case. Im using typescript in full es6 mode, module and target are both es6. Babel isn't even in my node_modules.