Rich-Harris / shimport

Use JavaScript modules in all browsers, including dynamic imports

Home Page:https://shimport-demos.surge.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`export default` not correctly transformed when not followed by whitespace

Conduitry opened this issue · comments

Something like

export default[42]

is getting transformed in https://shimport-demos.surge.sh/transform/ to

__shimport__.define('demo.js', [], function(__import, __exports){ default[42]
});
//# sourceURL=demo.js

This is a contrived example, but export default( will appear in minified code that is exporting the result of an IIFE.

I'm guessing this needs adjusting but I have not tried anything yet.