@sveltejs/kit 1.0.0-next.217 → 1.0.0-next.218
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/kit.js +9 -1
- package/dist/chunks/index.js +3 -2
- package/dist/chunks/index3.js +3 -2
- package/dist/chunks/index5.js +2 -0
- package/dist/cli.js +2 -2
- package/dist/ssr.js +9 -1
- package/package.json +1 -1
- package/types/config.d.ts +2 -0
- package/types/internal.d.ts +1 -1
package/assets/kit.js
CHANGED
|
@@ -744,10 +744,18 @@ async function render_response({
|
|
|
744
744
|
headers['permissions-policy'] = 'interest-cohort=()';
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
+
const segments = url.pathname.slice(options.paths.base.length).split('/').slice(2);
|
|
748
|
+
const assets =
|
|
749
|
+
options.paths.assets || (segments.length > 0 ? segments.map(() => '..').join('/') : '.');
|
|
750
|
+
|
|
747
751
|
return {
|
|
748
752
|
status,
|
|
749
753
|
headers,
|
|
750
|
-
body: options.template({
|
|
754
|
+
body: options.template({
|
|
755
|
+
head,
|
|
756
|
+
body,
|
|
757
|
+
assets
|
|
758
|
+
})
|
|
751
759
|
};
|
|
752
760
|
}
|
|
753
761
|
|
package/dist/chunks/index.js
CHANGED
|
@@ -4406,10 +4406,11 @@ function create_plugin(config, output, cwd, amp) {
|
|
|
4406
4406
|
router: config.kit.router,
|
|
4407
4407
|
ssr: config.kit.ssr,
|
|
4408
4408
|
target: config.kit.target,
|
|
4409
|
-
template: ({ head, body }) => {
|
|
4409
|
+
template: ({ head, body, assets }) => {
|
|
4410
4410
|
let rendered = load_template(cwd, config)
|
|
4411
4411
|
.replace('%svelte.head%', () => head)
|
|
4412
|
-
.replace('%svelte.body%', () => body)
|
|
4412
|
+
.replace('%svelte.body%', () => body)
|
|
4413
|
+
.replace(/%svelte\.assets%/g, assets);
|
|
4413
4414
|
|
|
4414
4415
|
if (amp) {
|
|
4415
4416
|
const result = amp.validateString(rendered);
|
package/dist/chunks/index3.js
CHANGED
|
@@ -262,9 +262,10 @@ import { set_paths, assets, base } from './runtime/paths.js';
|
|
|
262
262
|
import { set_prerendering } from './runtime/env.js';
|
|
263
263
|
import * as user_hooks from ${s(hooks)};
|
|
264
264
|
|
|
265
|
-
const template = ({ head, body }) => ${s(load_template(cwd, config))
|
|
265
|
+
const template = ({ head, body, assets }) => ${s(load_template(cwd, config))
|
|
266
266
|
.replace('%svelte.head%', '" + head + "')
|
|
267
|
-
.replace('%svelte.body%', '" + body + "')
|
|
267
|
+
.replace('%svelte.body%', '" + body + "')
|
|
268
|
+
.replace(/%svelte\.assets%/g, '" + assets + "')};
|
|
268
269
|
|
|
269
270
|
let read = null;
|
|
270
271
|
|
package/dist/chunks/index5.js
CHANGED
package/dist/cli.js
CHANGED
|
@@ -846,7 +846,7 @@ async function launch(port, https) {
|
|
|
846
846
|
exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
|
|
847
847
|
}
|
|
848
848
|
|
|
849
|
-
const prog = sade('svelte-kit').version('1.0.0-next.
|
|
849
|
+
const prog = sade('svelte-kit').version('1.0.0-next.218');
|
|
850
850
|
|
|
851
851
|
prog
|
|
852
852
|
.command('dev')
|
|
@@ -998,7 +998,7 @@ async function check_port(port) {
|
|
|
998
998
|
function welcome({ port, host, https, open, loose, allow, cwd }) {
|
|
999
999
|
if (open) launch(port, https);
|
|
1000
1000
|
|
|
1001
|
-
console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.
|
|
1001
|
+
console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.218'}\n`));
|
|
1002
1002
|
|
|
1003
1003
|
const protocol = https ? 'https:' : 'http:';
|
|
1004
1004
|
const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
|
package/dist/ssr.js
CHANGED
|
@@ -713,10 +713,18 @@ async function render_response({
|
|
|
713
713
|
headers['permissions-policy'] = 'interest-cohort=()';
|
|
714
714
|
}
|
|
715
715
|
|
|
716
|
+
const segments = url.pathname.slice(options.paths.base.length).split('/').slice(2);
|
|
717
|
+
const assets =
|
|
718
|
+
options.paths.assets || (segments.length > 0 ? segments.map(() => '..').join('/') : '.');
|
|
719
|
+
|
|
716
720
|
return {
|
|
717
721
|
status,
|
|
718
722
|
headers,
|
|
719
|
-
body: options.template({
|
|
723
|
+
body: options.template({
|
|
724
|
+
head,
|
|
725
|
+
body,
|
|
726
|
+
assets
|
|
727
|
+
})
|
|
720
728
|
};
|
|
721
729
|
}
|
|
722
730
|
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
package/types/internal.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ export interface SSRRenderOptions {
|
|
|
144
144
|
service_worker?: string;
|
|
145
145
|
ssr: boolean;
|
|
146
146
|
target: string;
|
|
147
|
-
template({ head, body }: { head: string; body: string }): string;
|
|
147
|
+
template({ head, body, assets }: { head: string; body: string; assets: string }): string;
|
|
148
148
|
trailing_slash: TrailingSlash;
|
|
149
149
|
}
|
|
150
150
|
|