Skip to content

Commit

Permalink
fix js map
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt committed Jan 10, 2025
1 parent 3999163 commit 782a8a2
Show file tree
Hide file tree
Showing 49 changed files with 52 additions and 51 deletions.
7 changes: 4 additions & 3 deletions .scripts/assets-build-tool/min.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ glob(config.source).then((files) => {
dest,
path.parse(target).name + ".map"
);
fs.outputFile(mappedTarget, output.map);
const normalized = output.map.replace(/(?:\\[rn])+/g, "\\n");
fs.outputFile(mappedTarget, normalized + "\n");
console.log(
`Mapped (${chalk.gray("from")}, ${chalk.cyan(
"to"
Expand Down Expand Up @@ -197,7 +198,6 @@ glob(config.source).then((files) => {
});

let { code, map } = transform({
filename: "style.css",
code: Buffer.from(reader),
minify: true,
sourceMap: true,
Expand Down Expand Up @@ -226,7 +226,8 @@ glob(config.source).then((files) => {
dest,
path.parse(target).name + ".map"
);
await fs.outputFile(mappedTarget, (map.toString().replace(/(?:\\[rn])+/g, "\\n")) + "\n");
const normalized = map.toString().replace(/(?:\\[rn])+/g, "\\n");
await fs.outputFile(mappedTarget, normalized + "\n");
console.log(
`Mapped (${chalk.gray("from")}, ${chalk.cyan(
"to"
Expand Down

Large diffs are not rendered by default.

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

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

Loading

0 comments on commit 782a8a2

Please sign in to comment.