Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
feat!(vite): upgrade to vite 4
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 11, 2022
1 parent 4641e8e commit 5d84f51
Show file tree
Hide file tree
Showing 9 changed files with 448 additions and 195 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"nuxt": "workspace:*",
"nuxt3": "workspace:nuxt@*",
"unbuild": "^1.0.2",
"vite": "^3.2.5",
"vite": "^4.0.0",
"vue": "3.2.45"
},
"devDependencies": {
Expand Down Expand Up @@ -72,8 +72,8 @@
"typescript": "^4.9.4",
"ufo": "^1.0.1",
"unbuild": "^1.0.2",
"vite": "^3.2.5",
"vitest": "^0.25.5",
"vite": "^4.0.0",
"vitest": "^0.25.7",
"vue-tsc": "^1.0.11"
},
"packageManager": "pnpm@7.18.1",
Expand Down
7 changes: 6 additions & 1 deletion packages/nuxt/src/app/components/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ export default defineComponent({

// We avoid rendering layout transition if there is no layout to render
return _wrapIf(Transition, hasLayout && transitionProps, {
default: () => _wrapIf(LayoutLoader, hasLayout && { key: layout.value, name: layout.value, hasTransition: process.dev ? !!transitionProps : undefined, ...context.attrs }, context.slots).default()
default: () => _wrapIf(LayoutLoader, hasLayout && {
key: layout.value,
name: layout.value,
...(process.dev ? { hasTransition: !!transitionProps } : {}),
...context.attrs
}, context.slots).default()
}).default()
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"devDependencies": {
"@types/lodash.template": "^4",
"@types/semver": "^7",
"@vitejs/plugin-vue": "^3.2.0",
"@unhead/schema": "^1.0.13",
"@vitejs/plugin-vue": "^4.0.0",
"nitropack": "^1.0.0",
"unbuild": "latest",
"vite": "~3.2.5"
"vite": "~4.0.0"
},
"dependencies": {
"c12": "^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"devDependencies": {
"playwright": "^1.28.1",
"unbuild": "latest",
"vitest": "^0.25.5"
"vitest": "^0.25.7"
},
"peerDependencies": {
"vue": "^3.2.45"
Expand Down
12 changes: 6 additions & 6 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"dependencies": {
"@nuxt/kit": "3.0.0",
"@rollup/plugin-replace": "^5.0.1",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue-jsx": "^2.1.1",
"@vitejs/plugin-vue": "^4.0.0",
"@vitejs/plugin-vue-jsx": "^3.0.0",
"autoprefixer": "^10.4.13",
"chokidar": "^3.5.3",
"cssnano": "^5.1.14",
Expand All @@ -44,13 +44,13 @@
"postcss": "^8.4.19",
"postcss-import": "^15.1.0",
"postcss-url": "^10.1.3",
"rollup": "^2.79.1",
"rollup": "^3.7.3",
"rollup-plugin-visualizer": "^5.8.3",
"ufo": "^1.0.1",
"unplugin": "^1.0.0",
"vite": "~3.2.5",
"vite-node": "^0.25.5",
"vite-plugin-checker": "^0.5.1",
"vite": "^4.0.0",
"vite-node": "^0.25.7",
"vite-plugin-checker": "^0.5.2",
"vue-bundle-renderer": "^1.0.0"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/vite/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ export async function buildServer (ctx: ViteBuildContext) {
external: ['#internal/nitro', ...ctx.nuxt.options.experimental.externalVue ? ['vue', 'vue-router'] : []],
output: {
entryFileNames: 'server.mjs',
preferConst: true,
// TODO: https://github.com/vitejs/vite/pull/8641
inlineDynamicImports: !ctx.nuxt.options.experimental.viteServerDynamicImports,
format: 'module'
format: 'module',
generatedCode: {
constBindings: true
}
},
onwarn (warning, rollupWarn) {
if (warning.code && ['UNUSED_EXTERNAL_IMPORT'].includes(warning.code)) {
Expand Down

0 comments on commit 5d84f51

Please sign in to comment.