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
If there is a comment or something which contains the string import, ./utils/stripper.js considers it as a module imports, and outputs a wrong JS string.
Try adding a comment // This will import mylibrary. to ./__test__/echoworker.worker.js somewhere. This will throw a SyntaxError.
The importRe regular expression in ./utils/stripper.js should be sophisticated, and / or some syntax interpretation should be applied.
If there is a comment or something which contains the string
import
,./utils/stripper.js
considers it as a module imports, and outputs a wrong JS string.// This will import mylibrary.
to./__test__/echoworker.worker.js
somewhere. This will throw aSyntaxError
.importRe
regular expression in./utils/stripper.js
should be sophisticated, and / or some syntax interpretation should be applied.The fix should pass this test: https://github.com/visvirial/workerloader-jest-transformer/blob/import-comment/__test__/import_in_comments_ts.worker.ts
Related: #4
The text was updated successfully, but these errors were encountered: