@sveltejs/kit 1.0.0-next.367 → 1.0.0-next.368
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/dist/cli.js +1 -1
- package/dist/vite.js +14 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/vite.js
CHANGED
|
@@ -2850,6 +2850,15 @@ function kit() {
|
|
|
2850
2850
|
/** @type {boolean} */
|
|
2851
2851
|
let is_build;
|
|
2852
2852
|
|
|
2853
|
+
/** @type {import('types').Logger} */
|
|
2854
|
+
let log;
|
|
2855
|
+
|
|
2856
|
+
/** @type {import('types').Prerendered} */
|
|
2857
|
+
let prerendered;
|
|
2858
|
+
|
|
2859
|
+
/** @type {import('types').BuildData} */
|
|
2860
|
+
let build_data;
|
|
2861
|
+
|
|
2853
2862
|
/**
|
|
2854
2863
|
* @type {{
|
|
2855
2864
|
* build_dir: string;
|
|
@@ -2970,7 +2979,7 @@ function kit() {
|
|
|
2970
2979
|
},
|
|
2971
2980
|
|
|
2972
2981
|
async writeBundle(_options, bundle) {
|
|
2973
|
-
|
|
2982
|
+
log = logger({
|
|
2974
2983
|
verbose: vite_config.logLevel === 'info'
|
|
2975
2984
|
});
|
|
2976
2985
|
|
|
@@ -3026,7 +3035,7 @@ function kit() {
|
|
|
3026
3035
|
process.env.SVELTEKIT_SERVER_BUILD_COMPLETED = 'true';
|
|
3027
3036
|
|
|
3028
3037
|
/** @type {import('types').BuildData} */
|
|
3029
|
-
|
|
3038
|
+
build_data = {
|
|
3030
3039
|
app_dir: svelte_config.kit.appDir,
|
|
3031
3040
|
manifest_data,
|
|
3032
3041
|
service_worker: options.service_worker_entry_file ? 'service-worker.js' : null, // TODO make file configurable?
|
|
@@ -3060,7 +3069,7 @@ function kit() {
|
|
|
3060
3069
|
|
|
3061
3070
|
log.info('Prerendering');
|
|
3062
3071
|
|
|
3063
|
-
|
|
3072
|
+
prerendered = await prerender({
|
|
3064
3073
|
config: svelte_config.kit,
|
|
3065
3074
|
entries: manifest_data.routes
|
|
3066
3075
|
.map((route) => (route.type === 'page' ? route.path : ''))
|
|
@@ -3082,7 +3091,9 @@ function kit() {
|
|
|
3082
3091
|
console.log(
|
|
3083
3092
|
`\nRun ${$.bold().cyan('npm run preview')} to preview your production build locally.`
|
|
3084
3093
|
);
|
|
3094
|
+
},
|
|
3085
3095
|
|
|
3096
|
+
async closeBundle() {
|
|
3086
3097
|
if (svelte_config.kit.adapter) {
|
|
3087
3098
|
const { adapt } = await import('./chunks/index2.js');
|
|
3088
3099
|
await adapt(svelte_config, build_data, prerendered, { log });
|
|
@@ -3093,9 +3104,7 @@ function kit() {
|
|
|
3093
3104
|
`See ${$.bold().cyan('https://kit.svelte.dev/docs/adapters')} to learn how to configure your app to run on the platform of your choosing`
|
|
3094
3105
|
);
|
|
3095
3106
|
}
|
|
3096
|
-
},
|
|
3097
3107
|
|
|
3098
|
-
closeBundle() {
|
|
3099
3108
|
if (is_build && svelte_config.kit.prerender.enabled) {
|
|
3100
3109
|
// this is necessary to close any open db connections, etc.
|
|
3101
3110
|
// TODO: prerender in a subprocess so we can exit in isolation
|