Closed SukkaW closed 9 months ago
The @rollup/plugin-commonjs introduces virtual modules when transpiling commonjs modules. In rollup, virtual modules start with \0 (something like import virtual from '\x00something').
@rollup/plugin-commonjs
\0
import virtual from '\x00something'
@napi-rs/magic-string can't handle \0 properly, causing SyntaxError: Unterminated string constant (1:33).
@napi-rs/magic-string
SyntaxError: Unterminated string constant (1:33)
The PR fixes that by replacing @napi-rs/magic-string with magic-string.
magic-string
@h-a-n-a Would you like to look into this, too?
@huozhi This is the issue I came up recently when running unit tests of bunchee. So I digged a little bit into this and created this PR.
Nice, I bumped to it as well. It would fix this issue
The
@rollup/plugin-commonjs
introduces virtual modules when transpiling commonjs modules. In rollup, virtual modules start with\0
(something likeimport virtual from '\x00something'
).@napi-rs/magic-string
can't handle\0
properly, causingSyntaxError: Unterminated string constant (1:33)
.The PR fixes that by replacing
@napi-rs/magic-string
withmagic-string
.@h-a-n-a Would you like to look into this, too?