Closed chasenlehara closed 5 years ago
Thanks, I'll try to take a look today. It seems likely that it's related to the string / comment algorithm and that can be a tough one to fix.
Might have been broken by this: https://github.com/stealjs/steal/pull/1430
@chasenlehara I have a solution that involves a regex i'm not super confident in. Is your example posted about a reduce down example? If so can you link me to the actual code that is a problem (assuming its an open source library).
Alternatively I could reduce what I've gotten as a prerelease and let you test to see if it fixes your issue.
Here’s the actual module: https://unpkg.com/simple-keyboard-layouts@1.9.12/build/layouts/french.js
Here’s how it was being imported: https://github.com/chasenlehara/steal-issue-1510/blob/e5b14a43b1530faa29455dbdeede63999ae66562/index.js#L1
Ok, my fix works with that. Thanks!
Should be fixed in 2.2.4. Thanks for filing the issue!
Thanks @matthewp!
Here’s an example of a module that steal doesn’t detect as ES6:
The error is:
Uncaught SyntaxError: Unexpected token 'export'
If you split the module into two lines, it’ll import correctly:
Here’s an example repo: https://github.com/chasenlehara/steal-issue-1510
This can be worked around with some config: