Skip to content

Commit

Permalink
Revert "[fix] set platform to neutral for cloudflare build (#8083)"
Browse files Browse the repository at this point in the history
This reverts commit ee7cd45.
  • Loading branch information
Rich-Harris committed Dec 13, 2022
1 parent df6feab commit 13c68ec
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
8 changes: 0 additions & 8 deletions .changeset/chilly-pumas-look.md

This file was deleted.

7 changes: 3 additions & 4 deletions packages/adapter-cloudflare-workers/index.js
Expand Up @@ -62,15 +62,14 @@ export default function ({ config = 'wrangler.toml' } = {}) {
);

await esbuild.build({
platform: 'neutral',
mainFields: ['module', 'main'],
conditions: ['worker'],
platform: 'browser',
sourcemap: 'linked',
target: 'es2020',
entryPoints: [`${tmp}/entry.js`],
outfile: main,
bundle: true,
external: ['__STATIC_CONTENT_MANIFEST']
external: ['__STATIC_CONTENT_MANIFEST'],
format: 'esm'
});

builder.log.minor('Copying assets...');
Expand Down
5 changes: 2 additions & 3 deletions packages/adapter-cloudflare/index.js
Expand Up @@ -54,14 +54,13 @@ export default function () {
});

await esbuild.build({
platform: 'neutral',
mainFields: ['module', 'main'],
conditions: ['worker'],
platform: 'browser',
sourcemap: 'linked',
target: 'es2020',
entryPoints: [`${tmp}/_worker.js`],
outfile: `${dest}/_worker.js`,
allowOverwrite: true,
format: 'esm',
bundle: true
});
}
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-netlify/index.js
Expand Up @@ -129,11 +129,11 @@ async function generate_edge_functions({ builder }) {
);

await esbuild.build({
platform: 'neutral',
mainFields: ['module', 'main'],
entryPoints: [`${tmp}/entry.js`],
outfile: '.netlify/edge-functions/render.js',
bundle: true,
format: 'esm',
platform: 'browser',
sourcemap: 'linked',
target: 'es2020'
});
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-vercel/index.js
Expand Up @@ -122,12 +122,12 @@ const plugin = function ({ external = [], edge, split } = {}) {
);

await esbuild.build({
platform: 'neutral',
mainFields: ['module', 'main'],
entryPoints: [`${tmp}/edge.js`],
outfile: `${dirs.functions}/${name}.func/index.js`,
target: 'es2020', // TODO verify what the edge runtime supports
bundle: true,
platform: 'browser',
format: 'esm',
external,
sourcemap: 'linked',
banner: { js: 'globalThis.global = globalThis;' }
Expand Down

0 comments on commit 13c68ec

Please sign in to comment.