Skip to content

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

@visvirial

Description

@visvirial

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions