@sveltejs/kit 1.0.0-next.203 → 1.0.0-next.208
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/runtime/internal/start.js +114 -119
- package/dist/chunks/index.js +100 -114
- package/dist/chunks/index2.js +29 -15
- package/dist/chunks/index3.js +403 -821
- package/dist/chunks/index4.js +89 -378
- package/dist/chunks/index5.js +524 -723
- package/dist/chunks/index6.js +737 -15485
- package/dist/chunks/index7.js +15575 -0
- package/dist/chunks/misc.js +3 -0
- package/dist/cli.js +91 -26
- package/dist/ssr.js +210 -135
- package/package.json +2 -3
- package/types/ambient-modules.d.ts +15 -7
- package/types/app.d.ts +29 -5
- package/types/config.d.ts +79 -12
- package/types/hooks.d.ts +16 -4
- package/types/index.d.ts +3 -3
- package/types/internal.d.ts +40 -28
- package/types/page.d.ts +2 -8
package/dist/chunks/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import require$$0$3 from 'domain';
|
|
|
12
12
|
import 'querystring';
|
|
13
13
|
import require$$10 from 'vm';
|
|
14
14
|
import CheapWatch from 'cheap-watch';
|
|
15
|
-
import { r as rimraf, c as copy_assets, p as print_config_conflicts, a as resolve_entry, $ } from '../cli.js';
|
|
15
|
+
import { r as rimraf, c as copy_assets, p as print_config_conflicts, g as get_mime_lookup, a as resolve_entry, $ } from '../cli.js';
|
|
16
16
|
import vite from 'vite';
|
|
17
17
|
import { respond } from '../ssr.js';
|
|
18
18
|
import { d as deep_merge, c as create_manifest_data, a as create_app } from './index2.js';
|
|
@@ -23,6 +23,7 @@ import { c as coalesce_to_error } from './error.js';
|
|
|
23
23
|
import 'sade';
|
|
24
24
|
import 'net';
|
|
25
25
|
import './url.js';
|
|
26
|
+
import './misc.js';
|
|
26
27
|
import 'node:http';
|
|
27
28
|
import 'node:https';
|
|
28
29
|
import 'node:zlib';
|
|
@@ -4277,7 +4278,7 @@ class Watcher extends EventEmitter {
|
|
|
4277
4278
|
this.config.kit.files.lib,
|
|
4278
4279
|
this.config.kit.files.routes,
|
|
4279
4280
|
path__default.resolve(this.cwd, 'src'),
|
|
4280
|
-
path__default.resolve(this.cwd,
|
|
4281
|
+
path__default.resolve(this.cwd, SVELTE_KIT),
|
|
4281
4282
|
path__default.resolve(this.cwd, 'node_modules'),
|
|
4282
4283
|
path__default.resolve(vite.searchForWorkspaceRoot(this.cwd), 'node_modules')
|
|
4283
4284
|
])
|
|
@@ -4302,7 +4303,7 @@ class Watcher extends EventEmitter {
|
|
|
4302
4303
|
// don't warn on overriding defaults
|
|
4303
4304
|
const [modified_vite_config] = deep_merge(default_config, vite_config);
|
|
4304
4305
|
|
|
4305
|
-
const kit_plugin = await create_plugin(this.config, this.dir, this.
|
|
4306
|
+
const kit_plugin = await create_plugin(this.config, this.dir, this.https, () => {
|
|
4306
4307
|
if (!this.manifest) {
|
|
4307
4308
|
throw new Error('Manifest is not available');
|
|
4308
4309
|
}
|
|
@@ -4358,7 +4359,6 @@ class Watcher extends EventEmitter {
|
|
|
4358
4359
|
}
|
|
4359
4360
|
|
|
4360
4361
|
this.vite = await vite.createServer(merged_config);
|
|
4361
|
-
remove_html_middlewares(this.vite.middlewares);
|
|
4362
4362
|
await this.vite.listen(this.port);
|
|
4363
4363
|
}
|
|
4364
4364
|
|
|
@@ -4375,33 +4375,85 @@ class Watcher extends EventEmitter {
|
|
|
4375
4375
|
cwd: this.cwd
|
|
4376
4376
|
});
|
|
4377
4377
|
|
|
4378
|
-
/** @type {import('types/
|
|
4378
|
+
/** @type {import('types/app').SSRManifest} */
|
|
4379
4379
|
this.manifest = {
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4380
|
+
appDir: this.config.kit.appDir,
|
|
4381
|
+
assets: new Set(manifest_data.assets.map((asset) => asset.file)),
|
|
4382
|
+
_: {
|
|
4383
|
+
mime: get_mime_lookup(manifest_data),
|
|
4384
|
+
entry: {
|
|
4385
|
+
file: `/${SVELTE_KIT}/dev/runtime/internal/start.js`,
|
|
4386
|
+
css: [],
|
|
4387
|
+
js: []
|
|
4388
|
+
},
|
|
4389
|
+
nodes: manifest_data.components.map((id) => {
|
|
4390
|
+
return async () => {
|
|
4391
|
+
const url = `/${id}`;
|
|
4392
|
+
|
|
4393
|
+
if (!this.vite) throw new Error('Vite server has not been initialized');
|
|
4394
|
+
|
|
4395
|
+
const module = /** @type {SSRComponent} */ (await this.vite.ssrLoadModule(url));
|
|
4396
|
+
const node = await this.vite.moduleGraph.getModuleByUrl(url);
|
|
4397
|
+
|
|
4398
|
+
if (!node) throw new Error(`Could not find node for ${url}`);
|
|
4399
|
+
|
|
4400
|
+
const deps = new Set();
|
|
4401
|
+
find_deps(node, deps);
|
|
4402
|
+
|
|
4403
|
+
const styles = new Set();
|
|
4404
|
+
|
|
4405
|
+
for (const dep of deps) {
|
|
4406
|
+
const parsed = new URL(dep.url, 'http://localhost/');
|
|
4407
|
+
const query = parsed.searchParams;
|
|
4408
|
+
|
|
4409
|
+
// TODO what about .scss files, etc?
|
|
4410
|
+
if (
|
|
4411
|
+
dep.file.endsWith('.css') ||
|
|
4412
|
+
(query.has('svelte') && query.get('type') === 'style')
|
|
4413
|
+
) {
|
|
4414
|
+
try {
|
|
4415
|
+
const mod = await this.vite.ssrLoadModule(dep.url);
|
|
4416
|
+
styles.add(mod.default);
|
|
4417
|
+
} catch {
|
|
4418
|
+
// this can happen with dynamically imported modules, I think
|
|
4419
|
+
// because the Vite module graph doesn't distinguish between
|
|
4420
|
+
// static and dynamic imports? TODO investigate, submit fix
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
|
|
4425
|
+
return {
|
|
4426
|
+
module,
|
|
4427
|
+
entry: url.endsWith('.svelte') ? url : url + '?import',
|
|
4428
|
+
css: [],
|
|
4429
|
+
js: [],
|
|
4430
|
+
styles: Array.from(styles)
|
|
4431
|
+
};
|
|
4432
|
+
};
|
|
4433
|
+
}),
|
|
4434
|
+
routes: manifest_data.routes.map((route) => {
|
|
4435
|
+
if (route.type === 'page') {
|
|
4436
|
+
return {
|
|
4437
|
+
type: 'page',
|
|
4438
|
+
pattern: route.pattern,
|
|
4439
|
+
params: get_params(route.params),
|
|
4440
|
+
a: route.a.map((id) => manifest_data.components.indexOf(id)),
|
|
4441
|
+
b: route.b.map((id) => manifest_data.components.indexOf(id))
|
|
4442
|
+
};
|
|
4443
|
+
}
|
|
4444
|
+
|
|
4385
4445
|
return {
|
|
4386
|
-
type: '
|
|
4446
|
+
type: 'endpoint',
|
|
4387
4447
|
pattern: route.pattern,
|
|
4388
4448
|
params: get_params(route.params),
|
|
4389
|
-
|
|
4390
|
-
|
|
4449
|
+
load: async () => {
|
|
4450
|
+
if (!this.vite) throw new Error('Vite server has not been initialized');
|
|
4451
|
+
const url = path__default.resolve(this.cwd, route.file);
|
|
4452
|
+
return await this.vite.ssrLoadModule(url);
|
|
4453
|
+
}
|
|
4391
4454
|
};
|
|
4392
|
-
}
|
|
4393
|
-
|
|
4394
|
-
return {
|
|
4395
|
-
type: 'endpoint',
|
|
4396
|
-
pattern: route.pattern,
|
|
4397
|
-
params: get_params(route.params),
|
|
4398
|
-
load: async () => {
|
|
4399
|
-
if (!this.vite) throw new Error('Vite server has not been initialized');
|
|
4400
|
-
const url = path__default.resolve(this.cwd, route.file);
|
|
4401
|
-
return await this.vite.ssrLoadModule(url);
|
|
4402
|
-
}
|
|
4403
|
-
};
|
|
4404
|
-
})
|
|
4455
|
+
})
|
|
4456
|
+
}
|
|
4405
4457
|
};
|
|
4406
4458
|
}
|
|
4407
4459
|
|
|
@@ -4424,31 +4476,15 @@ function get_params(array) {
|
|
|
4424
4476
|
// src/routes/[x]/[y]/[z]/svelte, create a function
|
|
4425
4477
|
// that turns a RegExpExecArray into ({ x, y, z })
|
|
4426
4478
|
|
|
4427
|
-
// input has already been decoded by decodeURI
|
|
4428
|
-
// now handle the rest that decodeURIComponent would do
|
|
4429
|
-
const d = /** @param {string} s */ (s) =>
|
|
4430
|
-
s
|
|
4431
|
-
.replace(/%23/g, '#')
|
|
4432
|
-
.replace(/%3[Bb]/g, ';')
|
|
4433
|
-
.replace(/%2[Cc]/g, ',')
|
|
4434
|
-
.replace(/%2[Ff]/g, '/')
|
|
4435
|
-
.replace(/%3[Ff]/g, '?')
|
|
4436
|
-
.replace(/%3[Aa]/g, ':')
|
|
4437
|
-
.replace(/%40/g, '@')
|
|
4438
|
-
.replace(/%26/g, '&')
|
|
4439
|
-
.replace(/%3[Dd]/g, '=')
|
|
4440
|
-
.replace(/%2[Bb]/g, '+')
|
|
4441
|
-
.replace(/%24/g, '$');
|
|
4442
|
-
|
|
4443
4479
|
/** @param {RegExpExecArray} match */
|
|
4444
4480
|
const fn = (match) => {
|
|
4445
4481
|
/** @type {Record<string, string>} */
|
|
4446
4482
|
const params = {};
|
|
4447
4483
|
array.forEach((key, i) => {
|
|
4448
4484
|
if (key.startsWith('...')) {
|
|
4449
|
-
params[key.slice(3)] =
|
|
4485
|
+
params[key.slice(3)] = match[i + 1] || '';
|
|
4450
4486
|
} else {
|
|
4451
|
-
params[key] =
|
|
4487
|
+
params[key] = match[i + 1];
|
|
4452
4488
|
}
|
|
4453
4489
|
});
|
|
4454
4490
|
return params;
|
|
@@ -4460,28 +4496,15 @@ function get_params(array) {
|
|
|
4460
4496
|
/**
|
|
4461
4497
|
* @param {import('types/config').ValidatedConfig} config
|
|
4462
4498
|
* @param {string} dir
|
|
4463
|
-
* @param {
|
|
4464
|
-
* @param {() => import('types/
|
|
4499
|
+
* @param {boolean} https
|
|
4500
|
+
* @param {() => import('types/app').SSRManifest} get_manifest
|
|
4465
4501
|
*/
|
|
4466
|
-
async function create_plugin(config, dir,
|
|
4502
|
+
async function create_plugin(config, dir, https, get_manifest) {
|
|
4467
4503
|
/**
|
|
4468
4504
|
* @type {amp_validator.Validator?}
|
|
4469
4505
|
*/
|
|
4470
4506
|
const validator = config.kit.amp ? await amphtmlValidator.getInstance() : null;
|
|
4471
4507
|
|
|
4472
|
-
/**
|
|
4473
|
-
* @param {import('vite').ModuleNode} node
|
|
4474
|
-
* @param {Set<import('vite').ModuleNode>} deps
|
|
4475
|
-
*/
|
|
4476
|
-
const find_deps = (node, deps) => {
|
|
4477
|
-
for (const dep of node.importedModules) {
|
|
4478
|
-
if (!deps.has(dep)) {
|
|
4479
|
-
deps.add(dep);
|
|
4480
|
-
find_deps(dep, deps);
|
|
4481
|
-
}
|
|
4482
|
-
}
|
|
4483
|
-
};
|
|
4484
|
-
|
|
4485
4508
|
/**
|
|
4486
4509
|
* @param {vite.ViteDevServer} vite
|
|
4487
4510
|
*/
|
|
@@ -4551,27 +4574,16 @@ async function create_plugin(config, dir, cwd, get_manifest) {
|
|
|
4551
4574
|
return res.end(err.reason || 'Invalid request body');
|
|
4552
4575
|
}
|
|
4553
4576
|
|
|
4554
|
-
const host = /** @type {string} */ (
|
|
4555
|
-
config.kit.host || req.headers[config.kit.hostHeader || 'host']
|
|
4556
|
-
);
|
|
4557
|
-
|
|
4558
4577
|
const rendered = await respond(
|
|
4559
4578
|
{
|
|
4579
|
+
url: new URL(`${https ? 'https' : 'http'}://${req.headers.host}${req.url}`),
|
|
4560
4580
|
headers: /** @type {import('types/helper').RequestHeaders} */ (req.headers),
|
|
4561
4581
|
method: req.method,
|
|
4562
|
-
host,
|
|
4563
|
-
path: parsed.pathname.replace(config.kit.paths.base, ''),
|
|
4564
|
-
query: parsed.searchParams,
|
|
4565
4582
|
rawBody: body
|
|
4566
4583
|
},
|
|
4567
4584
|
{
|
|
4568
4585
|
amp: config.kit.amp,
|
|
4569
4586
|
dev: true,
|
|
4570
|
-
entry: {
|
|
4571
|
-
file: `/${SVELTE_KIT}/dev/runtime/internal/start.js`,
|
|
4572
|
-
css: [],
|
|
4573
|
-
js: []
|
|
4574
|
-
},
|
|
4575
4587
|
floc: config.kit.floc,
|
|
4576
4588
|
get_stack: (error) => {
|
|
4577
4589
|
vite.ssrFixStacktrace(error);
|
|
@@ -4583,52 +4595,12 @@ async function create_plugin(config, dir, cwd, get_manifest) {
|
|
|
4583
4595
|
},
|
|
4584
4596
|
hooks,
|
|
4585
4597
|
hydrate: config.kit.hydrate,
|
|
4598
|
+
manifest: get_manifest(),
|
|
4586
4599
|
paths: {
|
|
4587
4600
|
base: config.kit.paths.base,
|
|
4588
4601
|
assets: config.kit.paths.assets ? SVELTE_KIT_ASSETS : config.kit.paths.base
|
|
4589
4602
|
},
|
|
4590
|
-
|
|
4591
|
-
const url = `/${id}`;
|
|
4592
|
-
|
|
4593
|
-
const module = /** @type {SSRComponent} */ (await vite.ssrLoadModule(url));
|
|
4594
|
-
const node = await vite.moduleGraph.getModuleByUrl(url);
|
|
4595
|
-
|
|
4596
|
-
if (!node) throw new Error(`Could not find node for ${url}`);
|
|
4597
|
-
|
|
4598
|
-
const deps = new Set();
|
|
4599
|
-
find_deps(node, deps);
|
|
4600
|
-
|
|
4601
|
-
const styles = new Set();
|
|
4602
|
-
|
|
4603
|
-
for (const dep of deps) {
|
|
4604
|
-
const parsed = new URL(dep.url, 'http://localhost/');
|
|
4605
|
-
const query = parsed.searchParams;
|
|
4606
|
-
|
|
4607
|
-
// TODO what about .scss files, etc?
|
|
4608
|
-
if (
|
|
4609
|
-
dep.file.endsWith('.css') ||
|
|
4610
|
-
(query.has('svelte') && query.get('type') === 'style')
|
|
4611
|
-
) {
|
|
4612
|
-
try {
|
|
4613
|
-
const mod = await vite.ssrLoadModule(dep.url);
|
|
4614
|
-
styles.add(mod.default);
|
|
4615
|
-
} catch {
|
|
4616
|
-
// this can happen with dynamically imported modules, I think
|
|
4617
|
-
// because the Vite module graph doesn't distinguish between
|
|
4618
|
-
// static and dynamic imports? TODO investigate, submit fix
|
|
4619
|
-
}
|
|
4620
|
-
}
|
|
4621
|
-
}
|
|
4622
|
-
|
|
4623
|
-
return {
|
|
4624
|
-
module,
|
|
4625
|
-
entry: url.endsWith('.svelte') ? url : url + '?import',
|
|
4626
|
-
css: [],
|
|
4627
|
-
js: [],
|
|
4628
|
-
styles: Array.from(styles)
|
|
4629
|
-
};
|
|
4630
|
-
},
|
|
4631
|
-
manifest: get_manifest(),
|
|
4603
|
+
prefix: '',
|
|
4632
4604
|
prerender: config.kit.prerender.enabled,
|
|
4633
4605
|
read: (file) => fs__default.readFileSync(path__default.join(config.kit.files.assets, file)),
|
|
4634
4606
|
root,
|
|
@@ -4714,6 +4686,7 @@ async function create_plugin(config, dir, cwd, get_manifest) {
|
|
|
4714
4686
|
*/
|
|
4715
4687
|
configureServer(vite) {
|
|
4716
4688
|
return () => {
|
|
4689
|
+
remove_html_middlewares(vite.middlewares);
|
|
4717
4690
|
vite.middlewares.use(create_kit_middleware(vite));
|
|
4718
4691
|
};
|
|
4719
4692
|
}
|
|
@@ -4743,4 +4716,17 @@ function remove_html_middlewares(server) {
|
|
|
4743
4716
|
}
|
|
4744
4717
|
}
|
|
4745
4718
|
|
|
4719
|
+
/**
|
|
4720
|
+
* @param {import('vite').ModuleNode} node
|
|
4721
|
+
* @param {Set<import('vite').ModuleNode>} deps
|
|
4722
|
+
*/
|
|
4723
|
+
function find_deps(node, deps) {
|
|
4724
|
+
for (const dep of node.importedModules) {
|
|
4725
|
+
if (!deps.has(dep)) {
|
|
4726
|
+
deps.add(dep);
|
|
4727
|
+
find_deps(dep, deps);
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
|
|
4746
4732
|
export { dev };
|
package/dist/chunks/index2.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs__default from 'fs';
|
|
2
2
|
import path__default from 'path';
|
|
3
|
+
import { s } from './misc.js';
|
|
3
4
|
import { m as mkdirp, b as posixify } from '../cli.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -99,8 +100,6 @@ function write_if_changed(file, code) {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
const s = JSON.stringify;
|
|
103
|
-
|
|
104
103
|
/** @typedef {import('types/internal').ManifestData} ManifestData */
|
|
105
104
|
|
|
106
105
|
/**
|
|
@@ -212,11 +211,13 @@ function generate_app(manifest_data) {
|
|
|
212
211
|
|
|
213
212
|
while (l--) {
|
|
214
213
|
pyramid = `
|
|
215
|
-
|
|
216
|
-
{
|
|
214
|
+
{#if components[${l + 1}]}
|
|
215
|
+
<svelte:component this={components[${l}]} {...(props_${l} || {})}>
|
|
217
216
|
${pyramid.replace(/\n/g, '\n\t\t\t\t\t')}
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
</svelte:component>
|
|
218
|
+
{:else}
|
|
219
|
+
<svelte:component this={components[${l}]} {...(props_${l} || {})} />
|
|
220
|
+
{/if}
|
|
220
221
|
`
|
|
221
222
|
.replace(/^\t\t\t/gm, '')
|
|
222
223
|
.trim();
|
|
@@ -391,7 +392,7 @@ var mime = new Mime(standard, other);
|
|
|
391
392
|
* @typedef {{
|
|
392
393
|
* content: string;
|
|
393
394
|
* dynamic: boolean;
|
|
394
|
-
*
|
|
395
|
+
* rest: boolean;
|
|
395
396
|
* }} Part
|
|
396
397
|
* @typedef {{
|
|
397
398
|
* basename: string;
|
|
@@ -519,13 +520,13 @@ function create_manifest_data({ config, output, cwd = process.cwd() }) {
|
|
|
519
520
|
if (last_part.dynamic) {
|
|
520
521
|
last_segment.push({
|
|
521
522
|
dynamic: false,
|
|
522
|
-
|
|
523
|
+
rest: false,
|
|
523
524
|
content: item.route_suffix
|
|
524
525
|
});
|
|
525
526
|
} else {
|
|
526
527
|
last_segment[last_segment.length - 1] = {
|
|
527
528
|
dynamic: false,
|
|
528
|
-
|
|
529
|
+
rest: false,
|
|
529
530
|
content: `${last_part.content}${item.route_suffix}`
|
|
530
531
|
};
|
|
531
532
|
}
|
|
@@ -542,6 +543,18 @@ function create_manifest_data({ config, output, cwd = process.cwd() }) {
|
|
|
542
543
|
const params = parent_params.slice();
|
|
543
544
|
params.push(...item.parts.filter((p) => p.dynamic).map((p) => p.content));
|
|
544
545
|
|
|
546
|
+
// TODO seems slightly backwards to derive the simple segment representation
|
|
547
|
+
// from the more complex form, rather than vice versa — maybe swap it round
|
|
548
|
+
const simple_segments = segments.map((segment) => {
|
|
549
|
+
return {
|
|
550
|
+
dynamic: segment.some((part) => part.dynamic),
|
|
551
|
+
rest: segment.some((part) => part.rest),
|
|
552
|
+
content: segment
|
|
553
|
+
.map((part) => (part.dynamic ? `[${part.content}]` : part.content))
|
|
554
|
+
.join('')
|
|
555
|
+
};
|
|
556
|
+
});
|
|
557
|
+
|
|
545
558
|
if (item.is_dir) {
|
|
546
559
|
const layout_reset = find_layout('__layout.reset', item.file);
|
|
547
560
|
const layout = find_layout('__layout', item.file);
|
|
@@ -591,6 +604,7 @@ function create_manifest_data({ config, output, cwd = process.cwd() }) {
|
|
|
591
604
|
|
|
592
605
|
routes.push({
|
|
593
606
|
type: 'page',
|
|
607
|
+
segments: simple_segments,
|
|
594
608
|
pattern,
|
|
595
609
|
params,
|
|
596
610
|
path,
|
|
@@ -602,6 +616,7 @@ function create_manifest_data({ config, output, cwd = process.cwd() }) {
|
|
|
602
616
|
|
|
603
617
|
routes.push({
|
|
604
618
|
type: 'endpoint',
|
|
619
|
+
segments: simple_segments,
|
|
605
620
|
pattern,
|
|
606
621
|
file: item.file,
|
|
607
622
|
params
|
|
@@ -670,14 +685,13 @@ function comparator(a, b) {
|
|
|
670
685
|
if (!a_sub_part) return 1; // b is more specific, so goes first
|
|
671
686
|
if (!b_sub_part) return -1;
|
|
672
687
|
|
|
673
|
-
|
|
674
|
-
if (a_sub_part.spread && b_sub_part.spread) {
|
|
688
|
+
if (a_sub_part.rest && b_sub_part.rest) {
|
|
675
689
|
// sort alphabetically
|
|
676
690
|
return a_sub_part.content < b_sub_part.content ? -1 : 1;
|
|
677
691
|
}
|
|
678
692
|
|
|
679
|
-
// If one is ...
|
|
680
|
-
if (a_sub_part.
|
|
693
|
+
// If one is ...rest order it later
|
|
694
|
+
if (a_sub_part.rest !== b_sub_part.rest) return a_sub_part.rest ? 1 : -1;
|
|
681
695
|
|
|
682
696
|
if (a_sub_part.dynamic !== b_sub_part.dynamic) {
|
|
683
697
|
return a_sub_part.dynamic ? 1 : -1;
|
|
@@ -719,7 +733,7 @@ function get_parts(part, file) {
|
|
|
719
733
|
result.push({
|
|
720
734
|
content,
|
|
721
735
|
dynamic,
|
|
722
|
-
|
|
736
|
+
rest: dynamic && /^\.{3}.+$/.test(content)
|
|
723
737
|
});
|
|
724
738
|
});
|
|
725
739
|
|
|
@@ -733,7 +747,7 @@ function get_parts(part, file) {
|
|
|
733
747
|
function get_pattern(segments, add_trailing_slash) {
|
|
734
748
|
const path = segments
|
|
735
749
|
.map((segment) => {
|
|
736
|
-
return segment[0].
|
|
750
|
+
return segment[0].rest
|
|
737
751
|
? '(?:\\/(.*))?'
|
|
738
752
|
: '\\/' +
|
|
739
753
|
segment
|