You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt to import a minimized CommonJS module (I'm using zingchart-nodejs.min via @zingsoft/zingchart-svelte).
What is Expected?
It should be imported with no errors.
What is actually happening?
An error regarding an unterminated string is reported. The location given is for a comment marker // in the middle of a quoted string.
I took a look at the code (src/lib.ts). It looks as though you're stripping comments out without handling the case where the comment marker is inside a quoted string.
Perhaps the easiest way to fix this is to add an option to specify that the module you're importing is already minified and has no comments, and then don't call removeComments() if this option is enabled. Alternatively, you can just remove removeComments() completely, it doesn't matter if you convert a require into an import inside a comment.
The text was updated successfully, but these errors were encountered:
Versions
Reproduction
Attempt to import a minimized CommonJS module (I'm using zingchart-nodejs.min via @zingsoft/zingchart-svelte).
What is Expected?
It should be imported with no errors.
What is actually happening?
An error regarding an unterminated string is reported. The location given is for a comment marker
//
in the middle of a quoted string.I took a look at the code (src/lib.ts). It looks as though you're stripping comments out without handling the case where the comment marker is inside a quoted string.
Perhaps the easiest way to fix this is to add an option to specify that the module you're importing is already minified and has no comments, and then don't call
removeComments()
if this option is enabled. Alternatively, you can just removeremoveComments()
completely, it doesn't matter if you convert arequire
into animport
inside a comment.The text was updated successfully, but these errors were encountered: