Skip to content

Commit 0c5d240

Browse files
committed
update adapter-netlify
1 parent 2e82ad6 commit 0c5d240

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

packages/adapter-netlify/index.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import { appendFileSync, existsSync, readFileSync, writeFileSync } from 'fs';
22
import { join, resolve } from 'path';
33
import { fileURLToPath } from 'url';
4-
import esbuild from 'esbuild';
54
import toml from '@iarna/toml';
65

7-
/**
8-
* @typedef {import('esbuild').BuildOptions} BuildOptions
9-
*/
10-
116
/** @type {import('.')} */
12-
export default function (options) {
7+
export default function () {
138
return {
149
name: '@sveltejs/adapter-netlify',
1510

@@ -24,24 +19,7 @@ export default function (options) {
2419
const files = fileURLToPath(new URL('./files', import.meta.url));
2520

2621
utils.log.minor('Generating serverless function...');
27-
utils.copy(join(files, 'entry.js'), '.svelte-kit/netlify/entry.js');
28-
29-
/** @type {BuildOptions} */
30-
const default_options = {
31-
entryPoints: ['.svelte-kit/netlify/entry.js'],
32-
// Any functions in ".netlify/functions-internal" are bundled in addition to user-defined Netlify functions.
33-
// See https://github.com/netlify/build/pull/3213 for more details
34-
outfile: '.netlify/functions-internal/__render.js',
35-
bundle: true,
36-
inject: [join(files, 'shims.js')],
37-
platform: 'node'
38-
};
39-
40-
const build_options =
41-
options && options.esbuild ? await options.esbuild(default_options) : default_options;
42-
43-
await esbuild.build(build_options);
44-
22+
utils.copy(files, '.netlify');
4523
writeFileSync(join('.netlify', 'package.json'), JSON.stringify({ type: 'commonjs' }));
4624

4725
utils.log.minor('Prerendering static pages...');

packages/adapter-netlify/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"./package.json": "./package.json"
1616
},
1717
"main": "index.js",
18+
"adapter": "files/entry.js",
1819
"types": "index.d.ts",
1920
"files": [
2021
"files",
@@ -26,8 +27,7 @@
2627
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore"
2728
},
2829
"dependencies": {
29-
"@iarna/toml": "^2.2.5",
30-
"esbuild": "^0.13.4"
30+
"@iarna/toml": "^2.2.5"
3131
},
3232
"devDependencies": {
3333
"@sveltejs/kit": "workspace:*"

packages/adapter-node/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"prepublishOnly": "npm run build"
2222
},
2323
"dependencies": {
24-
"esbuild": "^0.13.4",
2524
"tiny-glob": "^0.2.9"
2625
},
2726
"devDependencies": {

0 commit comments

Comments
 (0)