Skip to content

Commit feec1c8

Browse files
committed
tweaks
1 parent 1d854b7 commit feec1c8

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

packages/adapter-node/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default [
1111
sourcemap: true
1212
},
1313
plugins: [nodeResolve(), commonjs(), json()],
14-
external: ['../output/server/app.js', ...require('module').builtinModules]
14+
external: ['@sveltejs/kit-app', ...require('module').builtinModules]
1515
},
1616
{
1717
input: 'src/index.js',
@@ -21,7 +21,7 @@ export default [
2121
sourcemap: true
2222
},
2323
plugins: [nodeResolve(), commonjs(), json()],
24-
external: ['./middlewares.js', '../output/server/app.js', ...require('module').builtinModules]
24+
external: ['./middlewares.js', '@sveltejs/kit-app', ...require('module').builtinModules]
2525
},
2626
{
2727
input: 'src/shims.js',

packages/kit/src/core/build/index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import fs from 'fs';
2-
import { createRequire } from 'module';
32
import path from 'path';
43
import { svelte } from '@sveltejs/vite-plugin-svelte';
54
import glob from 'tiny-glob/sync.js';
@@ -293,13 +292,6 @@ async function build_server(
293292

294293
find_deps(client_entry_file, entry_js, entry_css);
295294

296-
const adapter = config.kit.adapter;
297-
// const require = createRequire(import.meta.url);
298-
// const pkg_path = require.resolve(`${adapter}/package.json`);
299-
// const pkg = JSON.parse(fs.readFileSync(pkg_path, 'utf8'));
300-
// const main = path.resolve(pkg_path.substring(0, pkg_path.lastIndexOf('/')), pkg.main);
301-
console.log(`adapter ${adapter}`);
302-
303295
fs.writeFileSync(
304296
`${build_dir}/package.json`,
305297
`{
@@ -311,10 +303,14 @@ console.log(`adapter ${adapter}`);
311303
}`
312304
);
313305

306+
// Write this in case in helps resolving node_modules to have the entry point
307+
// inside the current project. Still doesn't seem to work
308+
const adapter = config.kit.adapter;
314309
const entry_point = `${output_dir}/index.js`;
315310
fs.writeFileSync(
316311
entry_point,
317-
`import ${s(adapter)};`
312+
`import ${s(adapter)};
313+
`
318314
);
319315

320316
const app_file = `${build_dir}/app.js`;

packages/kit/src/core/config/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const options = object(
2323
}),
2424

2525
kit: object({
26-
adapter: validate(null, (input, keypath) => {
26+
adapter: validate(null, (input, _keypath) => {
2727
// if (typeof input !== 'object' || !input.adapt) {
2828
// let message = `${keypath} should be an object with an "adapt" method`;
2929

0 commit comments

Comments
 (0)