Skip to content

Commit 13c68ec

Browse files
authored
Revert "[fix] set platform to neutral for cloudflare build (#8083)"
This reverts commit ee7cd45.
1 parent df6feab commit 13c68ec

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed

.changeset/chilly-pumas-look.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/adapter-cloudflare-workers/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,14 @@ export default function ({ config = 'wrangler.toml' } = {}) {
6262
);
6363

6464
await esbuild.build({
65-
platform: 'neutral',
66-
mainFields: ['module', 'main'],
67-
conditions: ['worker'],
65+
platform: 'browser',
6866
sourcemap: 'linked',
6967
target: 'es2020',
7068
entryPoints: [`${tmp}/entry.js`],
7169
outfile: main,
7270
bundle: true,
73-
external: ['__STATIC_CONTENT_MANIFEST']
71+
external: ['__STATIC_CONTENT_MANIFEST'],
72+
format: 'esm'
7473
});
7574

7675
builder.log.minor('Copying assets...');

packages/adapter-cloudflare/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,13 @@ export default function () {
5454
});
5555

5656
await esbuild.build({
57-
platform: 'neutral',
58-
mainFields: ['module', 'main'],
59-
conditions: ['worker'],
57+
platform: 'browser',
6058
sourcemap: 'linked',
6159
target: 'es2020',
6260
entryPoints: [`${tmp}/_worker.js`],
6361
outfile: `${dest}/_worker.js`,
6462
allowOverwrite: true,
63+
format: 'esm',
6564
bundle: true
6665
});
6766
}

packages/adapter-netlify/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ async function generate_edge_functions({ builder }) {
129129
);
130130

131131
await esbuild.build({
132-
platform: 'neutral',
133-
mainFields: ['module', 'main'],
134132
entryPoints: [`${tmp}/entry.js`],
135133
outfile: '.netlify/edge-functions/render.js',
136134
bundle: true,
135+
format: 'esm',
136+
platform: 'browser',
137137
sourcemap: 'linked',
138138
target: 'es2020'
139139
});

packages/adapter-vercel/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ const plugin = function ({ external = [], edge, split } = {}) {
122122
);
123123

124124
await esbuild.build({
125-
platform: 'neutral',
126-
mainFields: ['module', 'main'],
127125
entryPoints: [`${tmp}/edge.js`],
128126
outfile: `${dirs.functions}/${name}.func/index.js`,
129127
target: 'es2020', // TODO verify what the edge runtime supports
130128
bundle: true,
129+
platform: 'browser',
130+
format: 'esm',
131131
external,
132132
sourcemap: 'linked',
133133
banner: { js: 'globalThis.global = globalThis;' }

0 commit comments

Comments
 (0)