homer0 / cjs2esm

Transforms a project that uses CommonJS to ES Modules.

Home Page:https://homer0.github.io/cjs2esm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creates empty exports

wmertens opened this issue · comments

Happens when rewriting a file that is already es module (but transpiled via webpack):

export default {foo: true}

becomes

const exported = {foo: true}

export default exported
export const {} = exported
export const {foo} = exported

@wmertens Hey 👋 , can you provide me with the code generated by webpack? I want to check, but my theory is that your webpack is using Babel, and the output is incompatible with the named-export-generation transformation.