vitrify 0.6.9 → 0.6.12
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
CHANGED
|
@@ -35,10 +35,9 @@ const moduleChunks = {
|
|
|
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
|
-
|
|
41
|
-
return name;
|
|
40
|
+
return name;
|
|
42
41
|
}
|
|
43
42
|
else if (VIRTUAL_MODULES.some((virtualModule) => id.includes(virtualModule))) {
|
|
44
43
|
return VIRTUAL_MODULES.find((name) => id.includes(name));
|
|
@@ -496,7 +495,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
496
495
|
exclude: ['vue', 'vue-router', ...serverModules, ...builtinModules]
|
|
497
496
|
},
|
|
498
497
|
resolve: {
|
|
499
|
-
dedupe: ['vue', '
|
|
498
|
+
dedupe: ['vue', 'vue-router'],
|
|
500
499
|
alias
|
|
501
500
|
},
|
|
502
501
|
build: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const routesToPaths: (routes?:
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
export declare const routesToPaths: (routes?: RouteRecordRaw[]) => string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitrify",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Stefan van Herwijnen",
|
|
6
6
|
"description": "Pre-configured Vite CLI for your framework",
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"@fastify/static": "^6.4.0",
|
|
61
61
|
"@quasar/extras": "^1.14.2",
|
|
62
62
|
"@vitejs/plugin-vue": "^3.0.0-alpha.1",
|
|
63
|
-
"@vue/server-renderer": "^3.2.37",
|
|
64
63
|
"builtin-modules": "^3.3.0",
|
|
65
64
|
"cac": "^6.7.12",
|
|
66
65
|
"chalk": "^5.0.1",
|
|
@@ -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 { RouteRecordRaw } from 'vue-router'
|
|
3
3
|
|
|
4
|
-
export const routesToPaths = (routes?:
|
|
4
|
+
export const routesToPaths = (routes?: RouteRecordRaw[]) => {
|
|
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: RouteRecordRaw[], 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
|
@@ -54,9 +54,9 @@ const moduleChunks = {
|
|
|
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
|
+
return name
|
|
60
60
|
} else if (
|
|
61
61
|
VIRTUAL_MODULES.some((virtualModule) => id.includes(virtualModule))
|
|
62
62
|
) {
|
|
@@ -580,7 +580,7 @@ export const baseConfig = async ({
|
|
|
580
580
|
exclude: ['vue', 'vue-router', ...serverModules, ...builtinModules]
|
|
581
581
|
},
|
|
582
582
|
resolve: {
|
|
583
|
-
dedupe: ['vue', '
|
|
583
|
+
dedupe: ['vue', 'vue-router'],
|
|
584
584
|
alias
|
|
585
585
|
},
|
|
586
586
|
build: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createApp } from '../main.js'
|
|
2
|
-
import { renderToString } from 'vue/server-renderer'
|
|
2
|
+
// import { renderToString } from 'vue/server-renderer'
|
|
3
3
|
|
|
4
4
|
import { onRendered } from 'virtual:vitrify-hooks'
|
|
5
5
|
|
|
@@ -37,7 +37,9 @@ export const getRoutes = async () =>
|
|
|
37
37
|
})
|
|
38
38
|
).routes
|
|
39
39
|
|
|
40
|
-
export async function render(url, manifest, ssrContext) {
|
|
40
|
+
export async function render(url, manifest, ssrContext, renderToString) {
|
|
41
|
+
if (!renderToString)
|
|
42
|
+
renderToString = (await import('vue/server-renderer')).renderToString
|
|
41
43
|
const { app, router } = await initializeApp(url, ssrContext)
|
|
42
44
|
|
|
43
45
|
const ctx = {
|