Skip to content

Commit

Permalink
Improve sourcemap generation and performance (#7901)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Aug 2, 2023
1 parent 543d210 commit 00cb28f
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 27 deletions.
6 changes: 6 additions & 0 deletions .changeset/wise-glasses-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@astrojs/image': patch
'astro': patch
---

Improve sourcemap generation and performance
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"html-escaper": "^3.0.3",
"js-yaml": "^4.1.0",
"kleur": "^4.1.4",
"magic-string": "^0.27.0",
"magic-string": "^0.30.2",
"mime": "^3.0.0",
"network-information-types": "^0.1.1",
"ora": "^6.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/assets/vite-plugin-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default function assets({
if (s) {
return {
code: s.toString(),
map: resolvedConfig.build.sourcemap ? s.generateMap({ hires: true }) : null,
map: resolvedConfig.build.sourcemap ? s.generateMap({ hires: 'boundary' }) : null,
};
} else {
return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-astro-postprocess/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function astro(): Plugin {
if (s) {
return {
code: s.toString(),
map: s.generateMap({ hires: true }),
map: s.generateMap({ hires: 'boundary' }),
};
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function envVitePlugin({ settings }: EnvPluginOptions): vite.Plug
if (s) {
return {
code: s.toString(),
map: s.generateMap({ hires: true }),
map: s.generateMap({ hires: 'boundary' }),
};
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-html/transform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export async function transform(code: string, id: string) {

return {
code: s.toString(),
map: s.generateMap(),
map: s.generateMap({ hires: 'boundary' }),
};
}
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-scripts/page-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function astroScriptsPostPlugin({

return {
code: s.toString(),
map: s.generateMap({ hires: true }),
map: s.generateMap({ hires: 'boundary' }),
};
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"http-cache-semantics": "^4.1.1",
"image-size": "^1.0.2",
"kleur": "^4.1.5",
"magic-string": "^0.27.0",
"magic-string": "^0.30.2",
"mime": "^3.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/image/src/vite-plugin-astro-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function createPlugin(config: AstroConfig, options: Required<IntegrationO
if (s) {
return {
code: s.toString(),
map: resolvedConfig.build.sourcemap ? s.generateMap({ hires: true }) : null,
map: resolvedConfig.build.sourcemap ? s.generateMap({ hires: 'boundary' }) : null,
};
} else {
return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/webapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@ungap/structured-clone": "^0.3.4",
"chai": "^4.3.7",
"event-target-shim": "^6.0.2",
"magic-string": "^0.27.0",
"magic-string": "^0.30.2",
"mocha": "^9.2.2",
"rollup": "^2.79.1",
"tslib": "^2.5.3",
Expand Down
37 changes: 19 additions & 18 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 00cb28f

Please sign in to comment.