chore(deps): update dependency @vitejs/plugin-vue to v5.0.5 (main) (#27842)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
renovate[bot] 2024-06-30 00:02:51 +01:00 committed by GitHub
parent d747ef31bc
commit 5fc22f9db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 132 additions and 147 deletions

View File

@ -59,7 +59,7 @@
"@types/node": "20.14.9",
"@types/semver": "7.5.8",
"@unhead/schema": "1.9.14",
"@vitejs/plugin-vue": "5.0.4",
"@vitejs/plugin-vue": "5.0.5",
"@vitest/coverage-v8": "1.6.0",
"@vue/test-utils": "2.4.6",
"case-police": "0.6.1",

View File

@ -123,7 +123,7 @@
"@nuxt/ui-templates": "1.3.4",
"@parcel/watcher": "2.4.1",
"@types/estree": "1.0.5",
"@vitejs/plugin-vue": "5.0.4",
"@vitejs/plugin-vue": "5.0.5",
"@vue/compiler-sfc": "3.4.30",
"unbuild": "latest",
"vite": "5.3.1",

View File

@ -67,10 +67,19 @@ const treeshake = async (source: string): Promise<string> => {
}
async function SFCCompile (name: string, source: string, options: Options, ssr = false): Promise<string> {
const result = await (vuePlugin({
const plugin = vuePlugin({
compiler: VueCompilerSFC,
...options,
}).transform! as Function).call({
})
// @ts-expect-error Types are not correct as they are too generic
plugin.configResolved!({
isProduction: options.isProduction,
command: 'build',
root: process.cwd(),
build: { sourcemap: false },
define: {},
})
const result = await (plugin.transform! as Function).call({
parse: (code: string, opts: any = {}) => Parser.parse(code, {
sourceType: 'module',
ecmaVersion: 'latest',
@ -84,14 +93,16 @@ async function SFCCompile (name: string, source: string, options: Options, ssr =
return typeof result === 'string' ? result : result?.code
}
const stateToTest: { name: string, options: Partial<Options & { devServer: { config: { server: any } } }> }[] = [
const stateToTest: { index: number, name: string, options: Partial<Options & { devServer: { config: { server: any } } }> }[] = [
{
index: 0,
name: 'prod',
options: {
isProduction: true,
},
},
{
index: 1,
name: 'dev',
options: {
isProduction: false,
@ -107,93 +118,91 @@ const stateToTest: { name: string, options: Partial<Options & { devServer: { con
describe('treeshake client only in ssr', () => {
vi.spyOn(process, 'cwd').mockImplementation(() => '')
for (const [index, state] of stateToTest.entries()) {
it(`should treeshake ClientOnly correctly in ${state.name}`, async () => {
// add index to avoid using vite vue plugin cache
const clientResult = await SFCCompile(`SomeComponent${index}.vue`, WithClientOnly, state.options)
it.each(stateToTest)(`should treeshake ClientOnly correctly in $name`, async (state) => {
// add index to avoid using vite vue plugin cache
const clientResult = await SFCCompile(`SomeComponent${state.index}.vue`, WithClientOnly, state.options)
const ssrResult = await SFCCompile(`SomeComponent${index}.vue`, WithClientOnly, state.options, true)
const ssrResult = await SFCCompile(`SomeComponent${state.index}.vue`, WithClientOnly, state.options, true)
const treeshaken = await treeshake(ssrResult)
const [_, scopeId] = clientResult.match(/_pushScopeId\("(.*)"\)/)!
const treeshaken = await treeshake(ssrResult)
const [_, scopeId] = clientResult.match(/_pushScopeId\("(.*)"\)/)!
// ensure the id is correctly passed between server and client
expect(clientResult).toContain(`pushScopeId("${scopeId}")`)
expect(treeshaken).toContain(`<div ${scopeId}>`)
// ensure the id is correctly passed between server and client
expect(clientResult).toContain(`pushScopeId("${scopeId}")`)
expect(treeshaken).toContain(`<div ${scopeId}>`)
expect(clientResult).toContain('should-be-treeshaken')
expect(treeshaken).not.toContain('should-be-treeshaken')
expect(clientResult).toContain('should-be-treeshaken')
expect(treeshaken).not.toContain('should-be-treeshaken')
expect(treeshaken).not.toContain('import HelloWorld from \'../HelloWorld.vue\'')
expect(clientResult).toContain('import HelloWorld from \'../HelloWorld.vue\'')
expect(treeshaken).not.toContain('import HelloWorld from \'../HelloWorld.vue\'')
expect(clientResult).toContain('import HelloWorld from \'../HelloWorld.vue\'')
expect(treeshaken).not.toContain('import { Treeshaken } from \'somepath\'')
expect(clientResult).toContain('import { Treeshaken } from \'somepath\'')
expect(treeshaken).not.toContain('import { Treeshaken } from \'somepath\'')
expect(clientResult).toContain('import { Treeshaken } from \'somepath\'')
// remove resolved import
expect(treeshaken).not.toContain('const _component_ResolvedImport =')
expect(clientResult).toContain('const _component_ResolvedImport =')
// remove resolved import
expect(treeshaken).not.toContain('const _component_ResolvedImport =')
expect(clientResult).toContain('const _component_ResolvedImport =')
// treeshake multi line variable declaration
expect(clientResult).toContain('const SomeIsland = defineAsyncComponent(async () => {')
expect(treeshaken).not.toContain('const SomeIsland = defineAsyncComponent(async () => {')
expect(treeshaken).not.toContain('return (await import(\'./../some.island.vue\'))')
expect(treeshaken).toContain('const NotToBeTreeShaken = defineAsyncComponent(async () => {')
// treeshake multi line variable declaration
expect(clientResult).toContain('const SomeIsland = defineAsyncComponent(async () => {')
expect(treeshaken).not.toContain('const SomeIsland = defineAsyncComponent(async () => {')
expect(treeshaken).not.toContain('return (await import(\'./../some.island.vue\'))')
expect(treeshaken).toContain('const NotToBeTreeShaken = defineAsyncComponent(async () => {')
// treeshake object and array declaration
expect(treeshaken).not.toContain('const { ObjectPattern } = await import(\'nuxt.com\')')
expect(treeshaken).not.toContain('const { ObjectPattern: ObjectPatternDeclaration } = await import(\'nuxt.com\')')
expect(treeshaken).toContain('const { ButShouldNotBeTreeShaken } = defineAsyncComponent(async () => {')
expect(treeshaken).toContain('const [ { Dont, }, That] = defineAsyncComponent(async () => {')
// treeshake object and array declaration
expect(treeshaken).not.toContain('const { ObjectPattern } = await import(\'nuxt.com\')')
expect(treeshaken).not.toContain('const { ObjectPattern: ObjectPatternDeclaration } = await import(\'nuxt.com\')')
expect(treeshaken).toContain('const { ButShouldNotBeTreeShaken } = defineAsyncComponent(async () => {')
expect(treeshaken).toContain('const [ { Dont, }, That] = defineAsyncComponent(async () => {')
// treeshake object that has an assignment pattern
expect(treeshaken).toContain('const { woooooo, } = defineAsyncComponent(async () => {')
expect(treeshaken).not.toContain('const { Deep, assignment: { Pattern = ofComponent } } = defineAsyncComponent(async () => {')
// treeshake object that has an assignment pattern
expect(treeshaken).toContain('const { woooooo, } = defineAsyncComponent(async () => {')
expect(treeshaken).not.toContain('const { Deep, assignment: { Pattern = ofComponent } } = defineAsyncComponent(async () => {')
// expect no empty ObjectPattern on treeshaking
expect(treeshaken).not.toContain('const { } = defineAsyncComponent')
expect(treeshaken).not.toContain('import { } from')
// expect no empty ObjectPattern on treeshaking
expect(treeshaken).not.toContain('const { } = defineAsyncComponent')
expect(treeshaken).not.toContain('import { } from')
// expect components used in setup to not be removed
expect(treeshaken).toContain('import DontRemoveThisSinceItIsUsedInSetup from \'./ComponentWithProps.vue\'')
// expect components used in setup to not be removed
expect(treeshaken).toContain('import DontRemoveThisSinceItIsUsedInSetup from \'./ComponentWithProps.vue\'')
// expect import of ClientImport to be treeshaken but not Glob since it is also used outside <ClientOnly>
expect(treeshaken).not.toContain('ClientImport')
expect(treeshaken).toContain('import { Glob } from \'#components\'')
// expect import of ClientImport to be treeshaken but not Glob since it is also used outside <ClientOnly>
expect(treeshaken).not.toContain('ClientImport')
expect(treeshaken).toContain('import { Glob } from \'#components\'')
// treeshake .client slot
expect(treeshaken).not.toContain('ByeBye')
// don't treeshake variables that has the same name as .client components
expect(treeshaken).toContain('NotDotClientComponent')
expect(treeshaken).not.toContain('(DotClientComponent')
// treeshake .client slot
expect(treeshaken).not.toContain('ByeBye')
// don't treeshake variables that has the same name as .client components
expect(treeshaken).toContain('NotDotClientComponent')
expect(treeshaken).not.toContain('(DotClientComponent')
expect(treeshaken).not.toContain('AutoImportedComponent')
expect(treeshaken).toContain('AutoImportedNotTreeShakenComponent')
expect(treeshaken).not.toContain('AutoImportedComponent')
expect(treeshaken).toContain('AutoImportedNotTreeShakenComponent')
expect(treeshaken).not.toContain('Both')
expect(treeshaken).not.toContain('AreTreeshaken')
expect(treeshaken).not.toContain('Both')
expect(treeshaken).not.toContain('AreTreeshaken')
if (state.options.isProduction === false) {
// treeshake at inlined template
expect(treeshaken).not.toContain('ssrRenderComponent($setup["HelloWorld"]')
expect(treeshaken).toContain('ssrRenderComponent($setup["Glob"]')
} else {
// treeshake unref
expect(treeshaken).not.toContain('ssrRenderComponent(_unref(HelloWorld')
expect(treeshaken).toContain('ssrRenderComponent(_unref(Glob')
}
expect(treeshaken.replace(/data-v-\w{8}/g, 'data-v-one-hash').replace(/scoped=\w{8}/g, 'scoped=one-hash')).toMatchSnapshot()
})
}
if (state.options.isProduction === false) {
// treeshake at inlined template
expect(treeshaken).not.toContain('ssrRenderComponent($setup["HelloWorld"]')
expect(treeshaken).toContain('ssrRenderComponent($setup["Glob"]')
} else {
// treeshake unref
expect(treeshaken).not.toContain('ssrRenderComponent(_unref(HelloWorld')
expect(treeshaken).toContain('ssrRenderComponent(_unref(Glob')
}
expect(treeshaken.replace(/data-v-\w{8}/g, 'data-v-one-hash').replace(/scoped=\w{8}/g, 'scoped=one-hash')).toMatchSnapshot()
})
it('should not treeshake reused component #26137', async () => {
const treeshaken = await treeshake(`import { resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode } from "vue"
import { ssrRenderComponent as _ssrRenderComponent, ssrRenderAttrs as _ssrRenderAttrs } from "vue/server-renderer"
export function ssrRender(_ctx, _push, _parent, _attrs) {
const _component_AppIcon = _resolveComponent("AppIcon")
const _component_ClientOnly = _resolveComponent("ClientOnly")
_push(\`<div\${_ssrRenderAttrs(_attrs)}>\`)
_push(_ssrRenderComponent(_component_AppIcon, { name: "caret-left" }, null, _parent))
_push(_ssrRenderComponent(_component_ClientOnly, null, {

View File

@ -40,7 +40,7 @@
"@types/pug": "2.0.10",
"@types/sass-loader": "8.0.8",
"@unhead/schema": "1.9.14",
"@vitejs/plugin-vue": "5.0.4",
"@vitejs/plugin-vue": "5.0.5",
"@vitejs/plugin-vue-jsx": "4.0.0",
"@vue/compiler-core": "3.4.30",
"@vue/compiler-sfc": "3.4.30",

View File

@ -34,7 +34,7 @@
"dependencies": {
"@nuxt/kit": "workspace:*",
"@rollup/plugin-replace": "^5.0.7",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue": "^5.0.5",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"autoprefixer": "^10.4.19",
"clear": "^0.1.0",

View File

@ -59,8 +59,8 @@ importers:
specifier: 1.9.14
version: 1.9.14
'@vitejs/plugin-vue':
specifier: 5.0.4
version: 5.0.4(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
specifier: 5.0.5
version: 5.0.5(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
'@vitest/coverage-v8':
specifier: 1.6.0
version: 1.6.0(vitest@1.6.0(@types/node@20.14.9)(happy-dom@14.12.3)(sass@1.69.4)(terser@5.27.0))
@ -277,7 +277,7 @@ importers:
version: 1.9.14(vue@3.4.30(typescript@5.5.2))
'@vue/shared':
specifier: ^3.4.30
version: 3.4.30
version: 3.4.31
acorn:
specifier: 8.12.0
version: 8.12.0
@ -400,7 +400,7 @@ importers:
version: 3.7.2(rollup@4.18.0)
unplugin:
specifier: ^1.10.1
version: 1.10.1
version: 1.10.2
unplugin-vue-router:
specifier: ^0.10.0
version: 0.10.0(rollup@4.18.0)(vue-router@4.4.0(vue@3.4.30(typescript@5.5.2)))(vue@3.4.30(typescript@5.5.2))
@ -436,8 +436,8 @@ importers:
specifier: 1.0.5
version: 1.0.5
'@vitejs/plugin-vue':
specifier: 5.0.4
version: 5.0.4(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
specifier: 5.0.5
version: 5.0.5(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
'@vue/compiler-sfc':
specifier: 3.4.30
version: 3.4.30
@ -509,8 +509,8 @@ importers:
specifier: 1.9.14
version: 1.9.14
'@vitejs/plugin-vue':
specifier: 5.0.4
version: 5.0.4(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
specifier: 5.0.5
version: 5.0.5(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
'@vitejs/plugin-vue-jsx':
specifier: 4.0.0
version: 4.0.0(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
@ -623,8 +623,8 @@ importers:
specifier: ^5.0.7
version: 5.0.7(rollup@4.18.0)
'@vitejs/plugin-vue':
specifier: ^5.0.4
version: 5.0.4(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
specifier: ^5.0.5
version: 5.0.5(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
'@vitejs/plugin-vue-jsx':
specifier: ^4.0.0
version: 4.0.0(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))
@ -702,7 +702,7 @@ importers:
version: 1.9.0
unplugin:
specifier: ^1.10.1
version: 1.10.1
version: 1.10.2
vite:
specifier: 5.3.1
version: 5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0)
@ -841,7 +841,7 @@ importers:
version: 1.9.0
unplugin:
specifier: ^1.10.1
version: 1.10.1
version: 1.10.2
url-loader:
specifier: ^4.1.1
version: 4.1.1(file-loader@6.2.0(webpack@5.92.1))(webpack@5.92.1)
@ -908,7 +908,7 @@ importers:
version: 6.6.3
'@vue/shared':
specifier: latest
version: 3.4.30
version: 3.4.31
nuxt:
specifier: workspace:*
version: link:../packages/nuxt
@ -939,7 +939,7 @@ importers:
version: 6.6.3
'@vue/shared':
specifier: latest
version: 3.4.30
version: 3.4.31
iron-webcrypto:
specifier: latest
version: 1.2.1
@ -951,7 +951,7 @@ importers:
version: 1.9.14
unplugin:
specifier: latest
version: 1.10.1
version: 1.10.2
vue:
specifier: 3.4.30
version: 3.4.30(typescript@5.5.2)
@ -1010,7 +1010,7 @@ importers:
version: 6.6.3
'@vue/shared':
specifier: latest
version: 3.4.30
version: 3.4.31
unhead:
specifier: latest
version: 1.9.14
@ -1032,7 +1032,7 @@ importers:
version: 6.6.3
'@vue/shared':
specifier: latest
version: 3.4.30
version: 3.4.31
typescript:
specifier: 5.5.2
version: 5.5.2
@ -2966,8 +2966,8 @@ packages:
vite: 5.3.1
vue: 3.4.30
'@vitejs/plugin-vue@5.0.4':
resolution: {integrity: sha512-WS3hevEszI6CEVEx28F8RjTX97k3KsrcY6kvTg7+Whm5y3oYvcqzVeGCU3hxSAn4uY2CLCkeokkGKpoctccilQ==}
'@vitejs/plugin-vue@5.0.5':
resolution: {integrity: sha512-LOjm7XeIimLBZyzinBQ6OSm3UBCNVCpLkxGC0oWmm2YPzVZoxMsdvNVimLTBzpAnR9hl/yn1SHGuRfe6/Td9rQ==}
engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
vite: 5.3.1
@ -3090,6 +3090,9 @@ packages:
'@vue/shared@3.4.30':
resolution: {integrity: sha512-CLg+f8RQCHQnKvuHY9adMsMaQOcqclh6Z5V9TaoMgy0ut0tz848joZ7/CYFFyF/yZ5i2yaw7Fn498C+CNZVHIg==}
'@vue/shared@3.4.31':
resolution: {integrity: sha512-Yp3wtJk//8cO4NItOPpi3QkLExAr/aLBGZMmTtW9WpdwBCJpRM6zj9WgWktXAl8IDIozwNMByT45JP3tO3ACWA==}
'@vue/test-utils@2.4.6':
resolution: {integrity: sha512-FMxEjOpYNYiFe0GkaHsnJPXFHxQ6m4t8vI/ElPGpMWxZKpmRvQ33OIrvRXemy6yha03RxhOlQuy+gZMC3CQSow==}
@ -4608,15 +4611,9 @@ packages:
resolution: {integrity: sha512-O1Ld7Dr+nqPnmGpdhzLmMTQ4vAsD+rHwMm1NLUmoUFFymBOMKxCCrtDxqdBRYXdeEPEi3SyoR4TizJLQrnKBNA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
h3-nightly@1.12.1-1718872526.a15b8de:
resolution: {integrity: sha512-wzWKg5vfCvzET4H57hFLq8S8ENf9DnXn/0A8G/HRUg16CFOCYTp45nd3Ku8IJrF1HmKBpZngh9MpuXd8LTFlSA==}
h3-nightly@2.0.0-1718872656.6765a6e:
resolution: {integrity: sha512-LQ8hHOIzk+agD1p0K7UosByKuzDAKGLTnYsP0syV/XMr9E7pWmoaDSWkGdWjtLR9O3hinNqrXU1NW0kTmhiSag==}
h3@1.12.0:
resolution: {integrity: sha512-Zi/CcNeWBXDrFNlV0hUBJQR9F7a96RjMeAZweW/ZWkR9fuXrMcvKnSA63f/zZ9l0GgQOZDVHGvXivNN9PWOwhA==}
happy-dom@14.12.3:
resolution: {integrity: sha512-vsYlEs3E9gLwA1Hp+w3qzu+RUDFf4VTT8cyKqVICoZ2k7WM++Qyd2LwzyTi5bqMJFiIC/vNpTDYuxdreENRK/g==}
engines: {node: '>=16.0.0'}
@ -7177,8 +7174,8 @@ packages:
vue-router:
optional: true
unplugin@1.10.1:
resolution: {integrity: sha512-d6Mhq8RJeGA8UfKCu54Um4lFA0eSaRa3XxdAJg8tIdxbu1ubW0hBCZUL7yI2uGyYCRndvbK8FLHzqy2XKfeMsg==}
unplugin@1.10.2:
resolution: {integrity: sha512-KuPqnjU4HBcrSwmQatfdc5hU4xzaQrhoKqCKylwmLnbBvqj5udXL8cHrkOuYDoI4ESCwJIiAIKMujroIUKLgow==}
engines: {node: '>=14.0.0'}
unstorage@1.10.2:
@ -8700,7 +8697,7 @@ snapshots:
consola: 3.2.3
defu: 6.1.4
estree-walker: 3.0.3
h3: 1.12.0
h3: h3-nightly@2.0.0-1718872656.6765a6e
magic-string: 0.30.10
mlly: 1.7.1
ofetch: 1.3.4(patch_hash=nxc3eojzwynarpj453xzxqr2f4)
@ -8714,7 +8711,7 @@ snapshots:
third-party-capital: 1.0.30
ufo: 1.5.3
unimport: 3.7.2(rollup@4.18.0)
unplugin: 1.10.1
unplugin: 1.10.2
unstorage: 1.10.2(ioredis@5.4.1)
valibot: 0.31.1
transitivePeerDependencies:
@ -8799,7 +8796,7 @@ snapshots:
std-env: 3.7.0
ufo: 1.5.3
unenv: 1.9.0
unplugin: 1.10.1
unplugin: 1.10.2
vite: 5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0)
vitest-environment-nuxt: 1.0.0(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.30)(vue@3.4.30(typescript@5.5.2)))(@vue/test-utils@2.4.6)(h3-nightly@2.0.0-1718872656.6765a6e)(happy-dom@14.12.3)(magicast@0.3.4)(nitropack@2.9.6(@opentelemetry/api@1.9.0)(encoding@0.1.13)(magicast@0.3.4))(playwright-core@1.45.0)(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.9)(happy-dom@14.12.3)(sass@1.69.4)(terser@5.27.0))(vue-router@4.4.0(vue@3.4.30(typescript@5.5.2)))(vue@3.4.30(typescript@5.5.2))
vue: 3.4.30(typescript@5.5.2)
@ -9902,7 +9899,7 @@ snapshots:
chokidar: 3.6.0
fast-glob: 3.3.2
magic-string: 0.30.10
unplugin: 1.10.1
unplugin: 1.10.2
webpack: 5.92.1(esbuild@0.21.5)
webpack-sources: 3.2.3
transitivePeerDependencies:
@ -9954,7 +9951,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@vitejs/plugin-vue@5.0.4(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))':
'@vitejs/plugin-vue@5.0.5(vite@5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0))(vue@3.4.30(typescript@5.5.2))':
dependencies:
vite: 5.3.1(@types/node@20.14.9)(sass@1.69.4)(terser@5.27.0)
vue: 3.4.30(typescript@5.5.2)
@ -10131,7 +10128,7 @@ snapshots:
'@volar/language-core': 1.11.1
'@volar/source-map': 1.11.1
'@vue/compiler-dom': 3.4.30
'@vue/shared': 3.4.30
'@vue/shared': 3.4.31
computeds: 0.0.1
minimatch: 9.0.4
muggle-string: 0.3.1
@ -10144,7 +10141,7 @@ snapshots:
dependencies:
'@volar/language-core': 2.3.3
'@vue/compiler-dom': 3.4.30
'@vue/shared': 3.4.30
'@vue/shared': 3.4.31
computeds: 0.0.1
minimatch: 9.0.4
muggle-string: 0.4.1
@ -10177,6 +10174,8 @@ snapshots:
'@vue/shared@3.4.30': {}
'@vue/shared@3.4.31': {}
'@vue/test-utils@2.4.6':
dependencies:
js-beautify: 1.14.9
@ -11927,21 +11926,6 @@ snapshots:
dependencies:
duplexer: 0.1.2
h3-nightly@1.12.1-1718872526.a15b8de:
dependencies:
cookie-es: 1.1.0
crossws: 0.2.4
defu: 6.1.4
destr: 2.0.3
iron-webcrypto: 1.2.1
ohash: 1.1.3
radix3: 1.1.2
ufo: 1.5.3
uncrypto: 0.1.3
unenv: 1.9.0
transitivePeerDependencies:
- uWebSockets.js
h3-nightly@2.0.0-1718872656.6765a6e:
dependencies:
cookie-es: 1.1.0
@ -11957,21 +11941,6 @@ snapshots:
transitivePeerDependencies:
- uWebSockets.js
h3@1.12.0:
dependencies:
cookie-es: 1.1.0
crossws: 0.2.4
defu: 6.1.4
destr: 2.0.3
iron-webcrypto: 1.2.1
ohash: 1.1.3
radix3: 1.1.2
ufo: 1.5.3
uncrypto: 0.1.3
unenv: 1.9.0
transitivePeerDependencies:
- uWebSockets.js
happy-dom@14.12.3:
dependencies:
entities: 4.5.0
@ -12541,7 +12510,7 @@ snapshots:
crossws: 0.2.4
defu: 6.1.4
get-port-please: 3.1.2
h3: 1.12.0
h3: h3-nightly@2.0.0-1718872656.6765a6e
http-shutdown: 1.2.2
jiti: 1.21.6
mlly: 1.7.1
@ -13201,7 +13170,7 @@ snapshots:
fs-extra: 11.2.0
globby: 14.0.1
gzip-size: 7.0.0
h3: h3-nightly@1.12.1-1718872526.a15b8de
h3: h3-nightly@2.0.0-1718872656.6765a6e
hookable: 5.5.3
httpxy: 0.1.5
ioredis: 5.4.1
@ -14927,7 +14896,7 @@ snapshots:
acorn: 8.12.0
estree-walker: 3.0.3
magic-string: 0.30.10
unplugin: 1.10.1
unplugin: 1.10.2
undici-types@5.26.5: {}
@ -14978,7 +14947,7 @@ snapshots:
pkg-types: 1.1.1
scule: 1.3.0
strip-literal: 2.1.0
unplugin: 1.10.1
unplugin: 1.10.2
transitivePeerDependencies:
- rollup
@ -15091,7 +15060,7 @@ snapshots:
mlly: 1.7.1
pathe: 1.1.2
scule: 1.3.0
unplugin: 1.10.1
unplugin: 1.10.2
yaml: 2.4.5
optionalDependencies:
vue-router: 4.4.0(vue@3.4.30(typescript@5.5.2))
@ -15099,7 +15068,7 @@ snapshots:
- rollup
- vue
unplugin@1.10.1:
unplugin@1.10.2:
dependencies:
acorn: 8.12.0
chokidar: 3.6.0
@ -15111,7 +15080,7 @@ snapshots:
anymatch: 3.1.3
chokidar: 3.6.0
destr: 2.0.3
h3: 1.12.0
h3: h3-nightly@2.0.0-1718872656.6765a6e
listhen: 1.7.2
lru-cache: 10.2.0
mri: 1.2.0
@ -15150,7 +15119,7 @@ snapshots:
mlly: 1.7.1
pathe: 1.1.2
pkg-types: 1.1.1
unplugin: 1.10.1
unplugin: 1.10.2
update-browserslist-db@1.0.16(browserslist@4.23.1):
dependencies:

View File

@ -27,7 +27,6 @@
"3.x"
],
"ignoreDeps": [
"@vitejs/plugin-vue",
"nitro",
"h3",
"nuxt",

View File

@ -24,9 +24,17 @@ await setup({
browser: true,
setupTimeout: (isWindows ? 360 : 120) * 1000,
nuxtConfig: {
hooks: {
'modules:done' () {
// TODO: investigate whether to upstream a fix to vite-plugin-vue or nuxt/test-utils
// Vite reads its `isProduction` value from NODE_ENV and passes this to some plugins
// like vite-plugin-vue
if (process.env.TEST_ENV !== 'dev') {
process.env.NODE_ENV = 'production'
}
},
},
builder: isWebpack ? 'webpack' : 'vite',
buildDir: process.env.NITRO_BUILD_DIR,
nitro: { output: { dir: process.env.NITRO_OUTPUT_DIR } },
},
})

View File

@ -32,7 +32,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
const serverDir = join(rootDir, '.output/server')
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"210k"`)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"205k"`)
const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1345k"`)
@ -73,7 +73,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
const serverDir = join(rootDir, '.output-inline/server')
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"531k"`)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"527k"`)
const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"80.3k"`)