@sveltejs/kit 1.0.0-next.348 → 1.0.0-next.349
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/server/index.js +3 -0
- package/dist/chunks/index.js +7 -8
- package/dist/chunks/index2.js +2 -0
- package/dist/chunks/index3.js +1 -2
- package/dist/chunks/index4.js +146 -198
- package/dist/chunks/index5.js +0 -2
- package/dist/chunks/plugin.js +1 -7
- package/dist/chunks/sync.js +2 -2
- package/dist/chunks/write_tsconfig.js +4 -1
- package/dist/cli.js +46 -137
- package/dist/node/polyfills.js +1 -1
- package/package.json +2 -2
- package/dist/chunks/cert.js +0 -28275
package/assets/server/index.js
CHANGED
|
@@ -1077,6 +1077,7 @@ const updated = {
|
|
|
1077
1077
|
};
|
|
1078
1078
|
|
|
1079
1079
|
/**
|
|
1080
|
+
* Creates the HTML response.
|
|
1080
1081
|
* @param {{
|
|
1081
1082
|
* branch: Array<import('./types').Loaded>;
|
|
1082
1083
|
* options: import('types').SSROptions;
|
|
@@ -2027,6 +2028,7 @@ function path_matches(path, constraint) {
|
|
|
2027
2028
|
}
|
|
2028
2029
|
|
|
2029
2030
|
/**
|
|
2031
|
+
* Calls the user's `load` function.
|
|
2030
2032
|
* @param {{
|
|
2031
2033
|
* event: import('types').RequestEvent;
|
|
2032
2034
|
* options: import('types').SSROptions;
|
|
@@ -2661,6 +2663,7 @@ async function respond_with_error({
|
|
|
2661
2663
|
*/
|
|
2662
2664
|
|
|
2663
2665
|
/**
|
|
2666
|
+
* Gets the nodes, calls `load` for each of them, and then calls render to build the HTML response.
|
|
2664
2667
|
* @param {{
|
|
2665
2668
|
* event: import('types').RequestEvent;
|
|
2666
2669
|
* options: SSROptions;
|
package/dist/chunks/index.js
CHANGED
|
@@ -12,8 +12,6 @@ import { pathToFileURL, URL as URL$1 } from 'url';
|
|
|
12
12
|
import { installPolyfills } from '../node/polyfills.js';
|
|
13
13
|
import './write_tsconfig.js';
|
|
14
14
|
import 'chokidar';
|
|
15
|
-
import 'net';
|
|
16
|
-
import 'child_process';
|
|
17
15
|
import 'sade';
|
|
18
16
|
import 'os';
|
|
19
17
|
import 'node:http';
|
|
@@ -89,7 +87,10 @@ function normalize_path(path, trailing_slash) {
|
|
|
89
87
|
* @typedef {import('rollup').OutputAsset} OutputAsset
|
|
90
88
|
*/
|
|
91
89
|
|
|
92
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Invokes Vite.
|
|
92
|
+
* @param {import('vite').UserConfig} config
|
|
93
|
+
*/
|
|
93
94
|
async function create_build(config) {
|
|
94
95
|
const { output } = /** @type {RollupOutput} */ (await vite.build(config));
|
|
95
96
|
|
|
@@ -105,6 +106,7 @@ async function create_build(config) {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
/**
|
|
109
|
+
* Adds transitive JS and CSS dependencies to the js and css inputs.
|
|
108
110
|
* @param {string} file
|
|
109
111
|
* @param {import('vite').Manifest} manifest
|
|
110
112
|
* @param {Set<string>} css
|
|
@@ -126,6 +128,7 @@ function find_deps(file, manifest, js, css) {
|
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
/**
|
|
131
|
+
* The Vite configuration that we use by default.
|
|
129
132
|
* @param {{
|
|
130
133
|
* client_out_dir?: string;
|
|
131
134
|
* config: import('types').ValidatedConfig;
|
|
@@ -158,10 +161,6 @@ const get_default_config = function ({ client_out_dir, config, input, output_dir
|
|
|
158
161
|
plugins: [
|
|
159
162
|
svelte({
|
|
160
163
|
...config,
|
|
161
|
-
compilerOptions: {
|
|
162
|
-
...config.compilerOptions,
|
|
163
|
-
hydratable: !!config.kit.browser.hydrate
|
|
164
|
-
},
|
|
165
164
|
configFile: false
|
|
166
165
|
})
|
|
167
166
|
],
|
|
@@ -406,7 +405,7 @@ export class Server {
|
|
|
406
405
|
error.stack = this.options.get_stack(error);
|
|
407
406
|
},
|
|
408
407
|
hooks: null,
|
|
409
|
-
hydrate: ${s(config.
|
|
408
|
+
hydrate: ${s(config.compilerOptions.hydratable)},
|
|
410
409
|
manifest,
|
|
411
410
|
method_override: ${s(config.kit.methodOverride)},
|
|
412
411
|
paths: { base, assets },
|
package/dist/chunks/index2.js
CHANGED
|
@@ -2,6 +2,8 @@ import { s, p as parse_route_id } from './misc.js';
|
|
|
2
2
|
import { b as get_mime_lookup } from '../cli.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* Generates the data used to write the server-side manifest.js file. This data is used in the Vite
|
|
6
|
+
* build process, to power routing, etc.
|
|
5
7
|
* @param {{
|
|
6
8
|
* build_data: import('types').BuildData;
|
|
7
9
|
* relative_path: string;
|
package/dist/chunks/index3.js
CHANGED
|
@@ -4,8 +4,6 @@ import { g as generate_manifest } from './index2.js';
|
|
|
4
4
|
import 'chokidar';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'path';
|
|
7
|
-
import 'net';
|
|
8
|
-
import 'child_process';
|
|
9
7
|
import 'sade';
|
|
10
8
|
import 'vite';
|
|
11
9
|
import 'url';
|
|
@@ -13,6 +11,7 @@ import 'os';
|
|
|
13
11
|
import './misc.js';
|
|
14
12
|
|
|
15
13
|
/**
|
|
14
|
+
* Creates the Builder which is passed to adapters for building the application.
|
|
16
15
|
* @param {{
|
|
17
16
|
* config: import('types').ValidatedConfig;
|
|
18
17
|
* build_data: import('types').BuildData;
|
package/dist/chunks/index4.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import fs__default from 'fs';
|
|
2
|
-
import http from 'http';
|
|
3
|
-
import https from 'https';
|
|
4
2
|
import { join } from 'path';
|
|
5
3
|
import { S as SVELTE_KIT_ASSETS, s as sirv } from './constants.js';
|
|
6
4
|
import { pathToFileURL } from 'url';
|
|
@@ -21,8 +19,6 @@ import 'node:fs';
|
|
|
21
19
|
import 'node:path';
|
|
22
20
|
import 'crypto';
|
|
23
21
|
import 'chokidar';
|
|
24
|
-
import 'net';
|
|
25
|
-
import 'child_process';
|
|
26
22
|
import 'sade';
|
|
27
23
|
import 'vite';
|
|
28
24
|
import 'os';
|
|
@@ -31,216 +27,168 @@ import 'os';
|
|
|
31
27
|
/** @typedef {import('http').ServerResponse} Res */
|
|
32
28
|
/** @typedef {(req: Req, res: Res, next: () => void) => void} Handler */
|
|
33
29
|
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
/** @type {import('types').ValidatedConfig} */
|
|
31
|
+
let config;
|
|
32
|
+
|
|
33
|
+
/** @type {boolean} */
|
|
34
|
+
let https;
|
|
35
|
+
|
|
36
|
+
/** @type {import('vite').Plugin} */
|
|
37
|
+
const sveltekit_plugin = {
|
|
38
|
+
name: 'vite-plugin-svelte-kit',
|
|
39
|
+
async config(vite_config) {
|
|
40
|
+
// defaults
|
|
41
|
+
vite_config.preview = vite_config.preview || {};
|
|
42
|
+
vite_config.preview.strictPort = vite_config.preview.strictPort ?? true;
|
|
43
|
+
|
|
44
|
+
config = await load_config();
|
|
45
|
+
},
|
|
46
|
+
async configResolved(vite_config) {
|
|
47
|
+
https = !!vite_config.preview.https;
|
|
48
|
+
},
|
|
49
|
+
async configurePreviewServer(vite) {
|
|
50
|
+
installPolyfills();
|
|
51
|
+
|
|
52
|
+
const { paths } = config.kit;
|
|
53
|
+
const base = paths.base;
|
|
54
|
+
const assets = paths.assets ? SVELTE_KIT_ASSETS : paths.base;
|
|
55
|
+
|
|
56
|
+
const etag = `"${Date.now()}"`;
|
|
57
|
+
|
|
58
|
+
const index_file = join(config.kit.outDir, 'output/server/index.js');
|
|
59
|
+
const manifest_file = join(config.kit.outDir, 'output/server/manifest.js');
|
|
60
|
+
|
|
61
|
+
/** @type {import('types').ServerModule} */
|
|
62
|
+
const { Server, override } = await import(pathToFileURL(index_file).href);
|
|
63
|
+
const { manifest } = await import(pathToFileURL(manifest_file).href);
|
|
64
|
+
|
|
65
|
+
override({
|
|
66
|
+
paths: { base, assets },
|
|
67
|
+
prerendering: false,
|
|
68
|
+
protocol: https ? 'https' : 'http',
|
|
69
|
+
read: (file) => fs__default.readFileSync(join(config.kit.files.assets, file))
|
|
70
|
+
});
|
|
45
71
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const server = new Server(manifest);
|
|
79
|
-
|
|
80
|
-
const handle = compose([
|
|
81
|
-
// files in `static`
|
|
82
|
-
scoped(assets, mutable(config.kit.files.assets)),
|
|
83
|
-
|
|
84
|
-
// immutable generated client assets
|
|
85
|
-
scoped(
|
|
86
|
-
assets,
|
|
87
|
-
sirv(join(config.kit.outDir, 'output/client'), {
|
|
88
|
-
setHeaders: (res, pathname) => {
|
|
89
|
-
// only apply to build directory, not e.g. version.json
|
|
90
|
-
if (pathname.startsWith(`/${config.kit.appDir}/immutable`)) {
|
|
91
|
-
res.setHeader('cache-control', 'public,max-age=31536000,immutable');
|
|
92
|
-
}
|
|
72
|
+
const server = new Server(manifest);
|
|
73
|
+
|
|
74
|
+
return () => {
|
|
75
|
+
// files in `static`
|
|
76
|
+
vite.middlewares.use(scoped(assets, mutable(config.kit.files.assets)));
|
|
77
|
+
|
|
78
|
+
// immutable generated client assets
|
|
79
|
+
vite.middlewares.use(
|
|
80
|
+
scoped(
|
|
81
|
+
assets,
|
|
82
|
+
sirv(join(config.kit.outDir, 'output/client'), {
|
|
83
|
+
setHeaders: (res, pathname) => {
|
|
84
|
+
// only apply to build directory, not e.g. version.json
|
|
85
|
+
if (pathname.startsWith(`/${config.kit.appDir}/immutable`)) {
|
|
86
|
+
res.setHeader('cache-control', 'public,max-age=31536000,immutable');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
vite.middlewares.use((req, res, next) => {
|
|
94
|
+
const original_url = /** @type {string} */ (req.url);
|
|
95
|
+
const { pathname } = new URL(original_url, 'http://dummy');
|
|
96
|
+
|
|
97
|
+
if (pathname.startsWith(base)) {
|
|
98
|
+
next();
|
|
99
|
+
} else {
|
|
100
|
+
res.statusCode = 404;
|
|
101
|
+
res.end(`Not found (did you mean ${base + pathname}?)`);
|
|
93
102
|
}
|
|
94
|
-
})
|
|
95
|
-
),
|
|
103
|
+
});
|
|
96
104
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
105
|
+
// prerendered dependencies
|
|
106
|
+
vite.middlewares.use(
|
|
107
|
+
scoped(base, mutable(join(config.kit.outDir, 'output/prerendered/dependencies')))
|
|
108
|
+
);
|
|
100
109
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
res
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
// prerendered dependencies
|
|
110
|
-
scoped(base, mutable(join(config.kit.outDir, 'output/prerendered/dependencies'))),
|
|
111
|
-
|
|
112
|
-
// prerendered pages (we can't just use sirv because we need to
|
|
113
|
-
// preserve the correct trailingSlash behaviour)
|
|
114
|
-
scoped(base, (req, res, next) => {
|
|
115
|
-
let if_none_match_value = req.headers['if-none-match'];
|
|
116
|
-
|
|
117
|
-
if (if_none_match_value?.startsWith('W/"')) {
|
|
118
|
-
if_none_match_value = if_none_match_value.substring(2);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (if_none_match_value === etag) {
|
|
122
|
-
res.statusCode = 304;
|
|
123
|
-
res.end();
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const { pathname } = new URL(/** @type {string} */ (req.url), 'http://dummy');
|
|
128
|
-
|
|
129
|
-
// only treat this as a page if it doesn't include an extension
|
|
130
|
-
if (pathname === '/' || /\/[^./]+\/?$/.test(pathname)) {
|
|
131
|
-
const file = join(
|
|
132
|
-
config.kit.outDir,
|
|
133
|
-
'output/prerendered/pages' + pathname + (pathname.endsWith('/') ? 'index.html' : '.html')
|
|
134
|
-
);
|
|
110
|
+
// prerendered pages (we can't just use sirv because we need to
|
|
111
|
+
// preserve the correct trailingSlash behaviour)
|
|
112
|
+
vite.middlewares.use(
|
|
113
|
+
scoped(base, (req, res, next) => {
|
|
114
|
+
let if_none_match_value = req.headers['if-none-match'];
|
|
135
115
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
etag
|
|
140
|
-
});
|
|
116
|
+
if (if_none_match_value?.startsWith('W/"')) {
|
|
117
|
+
if_none_match_value = if_none_match_value.substring(2);
|
|
118
|
+
}
|
|
141
119
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
120
|
+
if (if_none_match_value === etag) {
|
|
121
|
+
res.statusCode = 304;
|
|
122
|
+
res.end();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
146
125
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
getClientAddress: () => {
|
|
168
|
-
const { remoteAddress } = req.socket;
|
|
169
|
-
if (remoteAddress) return remoteAddress;
|
|
170
|
-
throw new Error('Could not determine clientAddress');
|
|
126
|
+
const { pathname } = new URL(/** @type {string} */ (req.url), 'http://dummy');
|
|
127
|
+
|
|
128
|
+
// only treat this as a page if it doesn't include an extension
|
|
129
|
+
if (pathname === '/' || /\/[^./]+\/?$/.test(pathname)) {
|
|
130
|
+
const file = join(
|
|
131
|
+
config.kit.outDir,
|
|
132
|
+
'output/prerendered/pages' +
|
|
133
|
+
pathname +
|
|
134
|
+
(pathname.endsWith('/') ? 'index.html' : '.html')
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
if (fs__default.existsSync(file)) {
|
|
138
|
+
res.writeHead(200, {
|
|
139
|
+
'content-type': 'text/html',
|
|
140
|
+
etag
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
fs__default.createReadStream(file).pipe(res);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
171
146
|
}
|
|
147
|
+
|
|
148
|
+
next();
|
|
172
149
|
})
|
|
173
150
|
);
|
|
174
|
-
}
|
|
175
|
-
]);
|
|
176
151
|
|
|
177
|
-
|
|
152
|
+
// SSR
|
|
153
|
+
vite.middlewares.use(async (req, res) => {
|
|
154
|
+
const protocol = https ? 'https' : 'http';
|
|
155
|
+
const host = req.headers['host'];
|
|
178
156
|
|
|
179
|
-
|
|
180
|
-
if (req.url == null) {
|
|
181
|
-
throw new Error('Invalid request url');
|
|
182
|
-
}
|
|
157
|
+
let request;
|
|
183
158
|
|
|
184
|
-
|
|
185
|
-
|
|
159
|
+
try {
|
|
160
|
+
request = await getRequest(`${protocol}://${host}`, req);
|
|
161
|
+
} catch (/** @type {any} */ err) {
|
|
162
|
+
res.statusCode = err.status || 400;
|
|
163
|
+
return res.end(err.reason || 'Invalid request body');
|
|
164
|
+
}
|
|
186
165
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
166
|
+
setResponse(
|
|
167
|
+
res,
|
|
168
|
+
await server.respond(request, {
|
|
169
|
+
getClientAddress: () => {
|
|
170
|
+
const { remoteAddress } = req.socket;
|
|
171
|
+
if (remoteAddress) return remoteAddress;
|
|
172
|
+
throw new Error('Could not determine clientAddress');
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
);
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
};
|
|
193
180
|
|
|
194
181
|
/**
|
|
195
|
-
* @param {
|
|
196
|
-
* @
|
|
197
|
-
* @param {(req: http.IncomingMessage, res: http.ServerResponse) => void} handler
|
|
198
|
-
* @returns {Promise<import('net').Server>}
|
|
182
|
+
* @param {string} dir
|
|
183
|
+
* @returns {Handler}
|
|
199
184
|
*/
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
: {};
|
|
208
|
-
|
|
209
|
-
if (secure_opts.key && secure_opts.cert) {
|
|
210
|
-
https_options.key = secure_opts.key.toString();
|
|
211
|
-
https_options.cert = secure_opts.cert.toString();
|
|
212
|
-
} else {
|
|
213
|
-
https_options.key = https_options.cert = (await import('./cert.js')).createCertificate();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return use_https
|
|
218
|
-
? https.createServer(/** @type {https.ServerOptions} */ (https_options), handler)
|
|
219
|
-
: http.createServer(handler);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/** @param {Handler[]} handlers */
|
|
223
|
-
function compose(handlers) {
|
|
224
|
-
/**
|
|
225
|
-
* @param {Req} req
|
|
226
|
-
* @param {Res} res
|
|
227
|
-
*/
|
|
228
|
-
return (req, res) => {
|
|
229
|
-
/** @param {number} i */
|
|
230
|
-
function next(i) {
|
|
231
|
-
const handler = handlers[i];
|
|
232
|
-
|
|
233
|
-
if (handler) {
|
|
234
|
-
handler(req, res, () => next(i + 1));
|
|
235
|
-
} else {
|
|
236
|
-
res.statusCode = 404;
|
|
237
|
-
res.end('Not found');
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
next(0);
|
|
242
|
-
};
|
|
243
|
-
}
|
|
185
|
+
const mutable = (dir) =>
|
|
186
|
+
fs__default.existsSync(dir)
|
|
187
|
+
? sirv(dir, {
|
|
188
|
+
etag: true,
|
|
189
|
+
maxAge: 0
|
|
190
|
+
})
|
|
191
|
+
: (req, res, next) => next();
|
|
244
192
|
|
|
245
193
|
/**
|
|
246
194
|
* @param {string} scope
|
|
@@ -264,4 +212,4 @@ function scoped(scope, handler) {
|
|
|
264
212
|
};
|
|
265
213
|
}
|
|
266
214
|
|
|
267
|
-
export {
|
|
215
|
+
export { sveltekit_plugin };
|
package/dist/chunks/index5.js
CHANGED
|
@@ -6,8 +6,6 @@ import chokidar from 'chokidar';
|
|
|
6
6
|
import { w as walk$1, m as mkdirp, p as posixify, r as rimraf, c as copy } from './filesystem.js';
|
|
7
7
|
import { createRequire } from 'module';
|
|
8
8
|
import { b as write_tsconfig } from './write_tsconfig.js';
|
|
9
|
-
import 'net';
|
|
10
|
-
import 'child_process';
|
|
11
9
|
import 'sade';
|
|
12
10
|
import 'vite';
|
|
13
11
|
import 'url';
|
package/dist/chunks/plugin.js
CHANGED
|
@@ -12,8 +12,6 @@ import { p as posixify } from './filesystem.js';
|
|
|
12
12
|
import { p as parse_route_id } from './misc.js';
|
|
13
13
|
import { d as deep_merge } from './object.js';
|
|
14
14
|
import 'chokidar';
|
|
15
|
-
import 'net';
|
|
16
|
-
import 'child_process';
|
|
17
15
|
import 'sade';
|
|
18
16
|
import 'os';
|
|
19
17
|
import 'querystring';
|
|
@@ -390,7 +388,7 @@ const sveltekit = function (svelte_config) {
|
|
|
390
388
|
});
|
|
391
389
|
},
|
|
392
390
|
hooks,
|
|
393
|
-
hydrate: svelte_config.
|
|
391
|
+
hydrate: svelte_config.compilerOptions.hydratable,
|
|
394
392
|
manifest,
|
|
395
393
|
method_override: svelte_config.kit.methodOverride,
|
|
396
394
|
paths: {
|
|
@@ -538,10 +536,6 @@ function has_correct_case(file, assets) {
|
|
|
538
536
|
const svelte = function (svelte_config) {
|
|
539
537
|
return svelte$1({
|
|
540
538
|
...svelte_config,
|
|
541
|
-
compilerOptions: {
|
|
542
|
-
...svelte_config.compilerOptions,
|
|
543
|
-
hydratable: !!svelte_config.kit.browser.hydrate
|
|
544
|
-
},
|
|
545
539
|
configFile: false
|
|
546
540
|
});
|
|
547
541
|
};
|
package/dist/chunks/sync.js
CHANGED
|
@@ -6,8 +6,6 @@ import { p as parse_route_id, s } from './misc.js';
|
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
import { w as write_if_changed, t as trim, a as write, b as write_tsconfig } from './write_tsconfig.js';
|
|
8
8
|
import 'chokidar';
|
|
9
|
-
import 'net';
|
|
10
|
-
import 'child_process';
|
|
11
9
|
import 'sade';
|
|
12
10
|
import 'vite';
|
|
13
11
|
import 'os';
|
|
@@ -589,6 +587,8 @@ function copy_assets(dest) {
|
|
|
589
587
|
}
|
|
590
588
|
|
|
591
589
|
/**
|
|
590
|
+
* Writes the client manifest to disk. The manifest is used to power the router. It contains the
|
|
591
|
+
* list of routes and corresponding Svelte components (i.e. pages and layouts).
|
|
592
592
|
* @param {import('types').ManifestData} manifest_data
|
|
593
593
|
* @param {string} base
|
|
594
594
|
* @param {string} output
|
|
@@ -36,7 +36,10 @@ function trim(str) {
|
|
|
36
36
|
/** @param {string} file */
|
|
37
37
|
const exists = (file) => fs__default.existsSync(file) && file;
|
|
38
38
|
|
|
39
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Writes the tsconfig that the user's tsconfig inherits from.
|
|
41
|
+
* @param {import('types').ValidatedKitConfig} config
|
|
42
|
+
*/
|
|
40
43
|
function write_tsconfig(config, cwd = process.cwd()) {
|
|
41
44
|
const out = path__default.join(config.outDir, 'tsconfig.json');
|
|
42
45
|
const user_file =
|