Skip to content

Commit

Permalink
Ignore sources starting with null characters in Rollup plugin
Browse files Browse the repository at this point in the history
FIX: The Rollup plugin will now ignore sources starting with null characters in
its resolve hook.

Closes #21
  • Loading branch information
marijnh committed Aug 27, 2024
1 parent e8c9d52 commit c228566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rollup-plugin-lezer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function lezer(config = {}) {
name: "rollup-plugin-lezer",

resolveId(source, importer) {
let m = /^(.*\.grammar)(\.terms)?$/.exec(source)
let m = /^([^\0].*\.grammar)(\.terms)?$/.exec(source)
if (!m) return null
let id = resolve(importer ? dirname(importer) : process.cwd(), m[1])
return m[2] ? `\0${id}.terms` : id
Expand Down

0 comments on commit c228566

Please sign in to comment.