Skip to content

Commit

Permalink
Generate sourcemaps (#5258)
Browse files Browse the repository at this point in the history
* Generate sourcemaps

* Update slimy-carpets-smash.md

Co-authored-by: Rich Harris <[email protected]>
  • Loading branch information
benmccann and Rich-Harris authored Jun 29, 2022
1 parent 4aac0c0 commit 8883ab7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/slimy-carpets-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@sveltejs/adapter-cloudflare': patch
'@sveltejs/adapter-cloudflare-workers': patch
'@sveltejs/adapter-netlify': patch
---

Generate sourcemaps for server-side functions when bundling with esbuild
3 changes: 2 additions & 1 deletion packages/adapter-cloudflare-workers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ export default function (options = {}) {
);

await esbuild.build({
target: 'es2020',
platform: 'browser',
sourcemap: 'linked',
target: 'es2020',
...options,
entryPoints: [`${tmp}/entry.js`],
outfile: main,
Expand Down
3 changes: 2 additions & 1 deletion packages/adapter-cloudflare/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ export default function (options = {}) {
});

await esbuild.build({
target: 'es2020',
platform: 'browser',
sourcemap: 'linked',
target: 'es2020',
...options,
entryPoints: [`${tmp}/_worker.js`],
outfile: `${dest}/_worker.js`,
Expand Down
5 changes: 3 additions & 2 deletions packages/adapter-netlify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ async function generate_edge_functions({ builder }) {
outfile: '.netlify/edge-functions/render.js',
bundle: true,
format: 'esm',
target: 'es2020',
platform: 'browser'
platform: 'browser',
sourcemap: 'linked',
target: 'es2020'
});

writeFileSync('.netlify/edge-functions/manifest.json', JSON.stringify(edge_manifest));
Expand Down

0 comments on commit 8883ab7

Please sign in to comment.