vitrify 0.6.7 → 0.6.10
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/index.js +14 -3
- package/dist/types/helpers/routes.d.ts +2 -2
- package/package.json +5 -5
- package/src/node/helpers/routes.ts +3 -3
- package/src/node/index.ts +14 -3
package/dist/index.js
CHANGED
|
@@ -31,14 +31,15 @@ const manualChunkNames = [
|
|
|
31
31
|
'server'
|
|
32
32
|
];
|
|
33
33
|
const moduleChunks = {
|
|
34
|
-
vue: ['vue', '@vue'],
|
|
34
|
+
vue: ['vue', '@vue', 'vue-router'],
|
|
35
35
|
quasar: ['quasar']
|
|
36
36
|
};
|
|
37
37
|
const manualChunks = (id, api) => {
|
|
38
|
-
if (id.includes('vitrify/src/
|
|
38
|
+
if (id.includes('vitrify/src/')) {
|
|
39
39
|
const name = id.split('/').at(-1)?.split('.').at(0);
|
|
40
40
|
if (name && manualChunkNames.includes(name))
|
|
41
41
|
return name;
|
|
42
|
+
return 'vitrify';
|
|
42
43
|
}
|
|
43
44
|
else if (VIRTUAL_MODULES.some((virtualModule) => id.includes(virtualModule))) {
|
|
44
45
|
return VIRTUAL_MODULES.find((name) => id.includes(name));
|
|
@@ -380,6 +381,10 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
380
381
|
{
|
|
381
382
|
find: new RegExp('^vue$'),
|
|
382
383
|
replacement: 'vue/dist/vue.runtime.esm-bundler.js'
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
find: new RegExp('^vue-router$'),
|
|
387
|
+
replacement: 'vue-router/dist/vue-router.esm-bundler.js'
|
|
383
388
|
}
|
|
384
389
|
// { find: 'vue', replacement: packageUrls['vue'].pathname },
|
|
385
390
|
// { find: 'vue-router', replacement: packageUrls['vue-router'].pathname },
|
|
@@ -489,7 +494,13 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
489
494
|
},
|
|
490
495
|
plugins,
|
|
491
496
|
optimizeDeps: {
|
|
492
|
-
exclude: [
|
|
497
|
+
exclude: [
|
|
498
|
+
'vue',
|
|
499
|
+
'vue-router',
|
|
500
|
+
'vue/server-renderer',
|
|
501
|
+
...serverModules,
|
|
502
|
+
...builtinModules
|
|
503
|
+
]
|
|
493
504
|
},
|
|
494
505
|
resolve: {
|
|
495
506
|
dedupe: ['vue', '@vue/server-renderer', 'vue-router'],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const routesToPaths: (routes?:
|
|
1
|
+
import type { RouteRecord } from 'vue-router';
|
|
2
|
+
export declare const routesToPaths: (routes?: RouteRecord[]) => string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitrify",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Stefan van Herwijnen",
|
|
6
6
|
"description": "Pre-configured Vite CLI for your framework",
|
|
@@ -87,18 +87,18 @@
|
|
|
87
87
|
"@types/node": "^18.0.1",
|
|
88
88
|
"@types/ws": "^8.5.3",
|
|
89
89
|
"@vue/runtime-core": "^3.2.37",
|
|
90
|
-
"quasar": "^2.7.
|
|
90
|
+
"quasar": "^2.7.5",
|
|
91
91
|
"rollup": "^2.75.7",
|
|
92
92
|
"typescript": "^4.7.4",
|
|
93
93
|
"vue": "^3.2.37",
|
|
94
|
-
"vue-router": "^4.0
|
|
94
|
+
"vue-router": "^4.1.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"@fastify/static": "^6.4.0",
|
|
98
98
|
"fastify": "^4.2.0",
|
|
99
|
-
"quasar": "^2.7.
|
|
99
|
+
"quasar": "^2.7.5",
|
|
100
100
|
"vue": "^3.2.37",
|
|
101
|
-
"vue-router": "^4.0
|
|
101
|
+
"vue-router": "^4.1.0"
|
|
102
102
|
},
|
|
103
103
|
"publishConfig": {
|
|
104
104
|
"access": "public",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// https://github.com/antfu/vite-ssg/blob/462722203dade87365a519d847fcd881ee16a7f4/src/node/utils.ts#L13
|
|
2
|
-
import type {
|
|
2
|
+
import type { RouteRecord } from 'vue-router'
|
|
3
3
|
|
|
4
|
-
export const routesToPaths = (routes?:
|
|
4
|
+
export const routesToPaths = (routes?: RouteRecord[]) => {
|
|
5
5
|
if (!routes) return ['/']
|
|
6
6
|
|
|
7
7
|
const paths: Set<string> = new Set()
|
|
8
8
|
|
|
9
|
-
const getPaths = (routes:
|
|
9
|
+
const getPaths = (routes: RouteRecord[], prefix = '') => {
|
|
10
10
|
// remove trailing slash
|
|
11
11
|
prefix = prefix.replace(/\/$/g, '')
|
|
12
12
|
for (const route of routes) {
|
package/src/node/index.ts
CHANGED
|
@@ -50,13 +50,14 @@ const manualChunkNames = [
|
|
|
50
50
|
]
|
|
51
51
|
|
|
52
52
|
const moduleChunks = {
|
|
53
|
-
vue: ['vue', '@vue'],
|
|
53
|
+
vue: ['vue', '@vue', 'vue-router'],
|
|
54
54
|
quasar: ['quasar']
|
|
55
55
|
}
|
|
56
56
|
const manualChunks: ManualChunksOption = (id, api) => {
|
|
57
|
-
if (id.includes('vitrify/src/
|
|
57
|
+
if (id.includes('vitrify/src/')) {
|
|
58
58
|
const name = id.split('/').at(-1)?.split('.').at(0)
|
|
59
59
|
if (name && manualChunkNames.includes(name)) return name
|
|
60
|
+
return 'vitrify'
|
|
60
61
|
} else if (
|
|
61
62
|
VIRTUAL_MODULES.some((virtualModule) => id.includes(virtualModule))
|
|
62
63
|
) {
|
|
@@ -462,6 +463,10 @@ export const baseConfig = async ({
|
|
|
462
463
|
{
|
|
463
464
|
find: new RegExp('^vue$'),
|
|
464
465
|
replacement: 'vue/dist/vue.runtime.esm-bundler.js'
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
find: new RegExp('^vue-router$'),
|
|
469
|
+
replacement: 'vue-router/dist/vue-router.esm-bundler.js'
|
|
465
470
|
}
|
|
466
471
|
// { find: 'vue', replacement: packageUrls['vue'].pathname },
|
|
467
472
|
// { find: 'vue-router', replacement: packageUrls['vue-router'].pathname },
|
|
@@ -573,7 +578,13 @@ export const baseConfig = async ({
|
|
|
573
578
|
},
|
|
574
579
|
plugins,
|
|
575
580
|
optimizeDeps: {
|
|
576
|
-
exclude: [
|
|
581
|
+
exclude: [
|
|
582
|
+
'vue',
|
|
583
|
+
'vue-router',
|
|
584
|
+
'vue/server-renderer',
|
|
585
|
+
...serverModules,
|
|
586
|
+
...builtinModules
|
|
587
|
+
]
|
|
577
588
|
},
|
|
578
589
|
resolve: {
|
|
579
590
|
dedupe: ['vue', '@vue/server-renderer', 'vue-router'],
|