Skip to content

Commit

Permalink
Use new feature to prevent errors on broken map
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Mar 17, 2024
1 parent 25354bd commit 1325896
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 8 additions & 2 deletions lib/map-generator.js
Expand Up @@ -100,7 +100,10 @@ class MapGenerator {
prev.file = this.outputFile()
this.map = SourceMapGenerator.fromSourceMap(prev)
} else {
this.map = new SourceMapGenerator({ file: this.outputFile() })
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
})
this.map.addMapping({
generated: { column: 0, line: 1 },
original: { column: 0, line: 1 },
Expand All @@ -123,7 +126,10 @@ class MapGenerator {

generateString() {
this.css = ''
this.map = new SourceMapGenerator({ file: this.outputFile() })
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
})

let line = 1
let column = 1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -86,7 +86,7 @@
"dependencies": {
"nanoid": "^3.3.7",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
"source-map-js": "^1.1.0"
},
"devDependencies": {
"@logux/eslint-config": "^53.0.0",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1325896

Please sign in to comment.