File tree 3 files changed +8
-12
lines changed
3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export default [
11
11
sourcemap : true
12
12
} ,
13
13
plugins : [ nodeResolve ( ) , commonjs ( ) , json ( ) ] ,
14
- external : [ '../output/server/ app.js ' , ...require ( 'module' ) . builtinModules ]
14
+ external : [ '@sveltejs/kit- app' , ...require ( 'module' ) . builtinModules ]
15
15
} ,
16
16
{
17
17
input : 'src/index.js' ,
@@ -21,7 +21,7 @@ export default [
21
21
sourcemap : true
22
22
} ,
23
23
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 ]
25
25
} ,
26
26
{
27
27
input : 'src/shims.js' ,
Original file line number Diff line number Diff line change 1
1
import fs from 'fs' ;
2
- import { createRequire } from 'module' ;
3
2
import path from 'path' ;
4
3
import { svelte } from '@sveltejs/vite-plugin-svelte' ;
5
4
import glob from 'tiny-glob/sync.js' ;
@@ -293,13 +292,6 @@ async function build_server(
293
292
294
293
find_deps ( client_entry_file , entry_js , entry_css ) ;
295
294
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
-
303
295
fs . writeFileSync (
304
296
`${ build_dir } /package.json` ,
305
297
`{
@@ -311,10 +303,14 @@ console.log(`adapter ${adapter}`);
311
303
}`
312
304
) ;
313
305
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 ;
314
309
const entry_point = `${ output_dir } /index.js` ;
315
310
fs . writeFileSync (
316
311
entry_point ,
317
- `import ${ s ( adapter ) } ;`
312
+ `import ${ s ( adapter ) } ;
313
+ `
318
314
) ;
319
315
320
316
const app_file = `${ build_dir } /app.js` ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const options = object(
23
23
} ) ,
24
24
25
25
kit : object ( {
26
- adapter : validate ( null , ( input , keypath ) => {
26
+ adapter : validate ( null , ( input , _keypath ) => {
27
27
// if (typeof input !== 'object' || !input.adapt) {
28
28
// let message = `${keypath} should be an object with an "adapt" method`;
29
29
You can’t perform that action at this time.
0 commit comments