perf(ssr): disable vite's pre-trasnfroming to improve perf (#2574)

This commit is contained in:
Anthony Fu 2022-01-06 02:31:24 +08:00 committed by GitHub
parent 1155d1b4d4
commit e9128f39a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View File

@ -55,7 +55,7 @@
"ufo": "^0.7.9", "ufo": "^0.7.9",
"unplugin": "^0.2.21", "unplugin": "^0.2.21",
"unplugin-vue2-script-setup": "0.8.3", "unplugin-vue2-script-setup": "0.8.3",
"vite": "^2.7.6", "vite": "^2.7.10",
"vite-plugin-vue2": "^1.9.0", "vite-plugin-vue2": "^1.9.0",
"vue-template-compiler": "^2.6.14" "vue-template-compiler": "^2.6.14"
}, },

View File

@ -37,7 +37,7 @@
"postcss-url": "^10.1.3", "postcss-url": "^10.1.3",
"rollup-plugin-visualizer": "^5.5.2", "rollup-plugin-visualizer": "^5.5.2",
"ufo": "^0.7.9", "ufo": "^0.7.9",
"vite": "^2.7.6" "vite": "^2.7.10"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "3.2.26" "vue": "3.2.26"

View File

@ -68,6 +68,10 @@ export async function buildServer (ctx: ViteBuildContext) {
} }
} }
}, },
server: {
// https://github.com/vitest-dev/vitest/issues/229#issuecomment-1002685027
preTransformRequests: false
},
plugins: [ plugins: [
cacheDirPlugin(ctx.nuxt.options.rootDir, 'server'), cacheDirPlugin(ctx.nuxt.options.rootDir, 'server'),
vuePlugin(ctx.config.vue), vuePlugin(ctx.config.vue),

View File

@ -2504,7 +2504,7 @@ __metadata:
unbuild: latest unbuild: latest
unplugin: ^0.2.21 unplugin: ^0.2.21
unplugin-vue2-script-setup: 0.8.3 unplugin-vue2-script-setup: 0.8.3
vite: ^2.7.6 vite: ^2.7.10
vite-plugin-vue2: ^1.9.0 vite-plugin-vue2: ^1.9.0
vue: ^2 vue: ^2
vue-router: ^3 vue-router: ^3
@ -3168,7 +3168,7 @@ __metadata:
rollup-plugin-visualizer: ^5.5.2 rollup-plugin-visualizer: ^5.5.2
ufo: ^0.7.9 ufo: ^0.7.9
unbuild: latest unbuild: latest
vite: ^2.7.6 vite: ^2.7.10
vue: 3.2.26 vue: 3.2.26
peerDependencies: peerDependencies:
vue: 3.2.26 vue: 3.2.26
@ -21505,9 +21505,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"vite@npm:^2.7.6": "vite@npm:^2.7.10":
version: 2.7.6 version: 2.7.10
resolution: "vite@npm:2.7.6" resolution: "vite@npm:2.7.10"
dependencies: dependencies:
esbuild: ^0.13.12 esbuild: ^0.13.12
fsevents: ~2.3.2 fsevents: ~2.3.2
@ -21530,7 +21530,7 @@ __metadata:
optional: true optional: true
bin: bin:
vite: bin/vite.js vite: bin/vite.js
checksum: 7aa110a3a5de9f9a29cf8cf461cf5dd2c7000d2a7abacdbe40969a215339492bee93d5eedb51060d13f0b6504511dd0d9e65b1dee4b0cf9ca5c277b046733312 checksum: 1757108547ca34bd01a8ee3973cb04b484492c9e5690fc75f54bbcbde5965ab6e0a5b8355c336adf0a9117aa0fdae3053af3aafa9e5eb783282fffa948cfbe11
languageName: node languageName: node
linkType: hard linkType: hard