Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile fails if there is a word import in comments #8

Open
visvirial opened this issue Jun 3, 2021 · 0 comments
Open

Compile fails if there is a word import in comments #8

visvirial opened this issue Jun 3, 2021 · 0 comments
Assignees

Comments

@visvirial
Copy link
Contributor

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.

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

@astagi astagi self-assigned this Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants