Skip to content

Commit

Permalink
chore(deps): update dependency vite to v5 (#971)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <[email protected]>
  • Loading branch information
renovate[bot] and danielroe authored Nov 20, 2023
1 parent 086bff3 commit 0047f60
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 38 deletions.
2 changes: 1 addition & 1 deletion packages/bridge-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@unhead/schema": "^1.8.4",
"nitropack": "^2.8.0",
"unbuild": "latest",
"vite": "~4.5.0"
"vite": "~5.0.0"
},
"dependencies": {
"c12": "^1.5.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@nuxt/postcss8": "^1.1.3",
"@nuxt/schema": "3.8.1",
"@nuxt/ui-templates": "^1.3.1",
"@rollup/plugin-replace": "^5.0.5",
"@unhead/ssr": "^1.8.4",
"@unhead/vue": "^1.8.4",
"@vitejs/plugin-legacy": "^5.0.0",
Expand Down Expand Up @@ -74,7 +75,7 @@
"unimport": "^3.5.0",
"unplugin": "^1.5.1",
"untyped": "^1.4.0",
"vite": "~4.5.0",
"vite": "~5.0.0",
"vite-node": "^0.34.6",
"vue-bundle-renderer": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge/src/vite/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function buildClient (ctx: ViteBuildContext) {
rollupOptions: {
input: resolve(ctx.nuxt.options.buildDir, 'client.js')
},
manifest: true,
manifest: 'manifest.json',
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/client')
},
plugins: [
Expand Down
17 changes: 10 additions & 7 deletions packages/bridge/src/vite/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import createVuePlugin from '@vitejs/plugin-vue2'
import { logger } from '@nuxt/kit'
import type { InlineConfig } from 'vite'
import { joinURL, withoutLeadingSlash, withTrailingSlash } from 'ufo'
import replace from '@rollup/plugin-replace'
import { initViteNodeServer } from '../vite-node'
import { mergeConfig, createServer, build } from './stub-vite.cjs'
import { wpfs } from './utils/wpfs'
Expand Down Expand Up @@ -48,12 +49,7 @@ export async function buildServer (ctx: ViteBuildContext) {
'process.client': false,
'process.static': false,
// use `process.client` instead. `process.browser` is deprecated
'process.browser': false,
'typeof window': '"undefined"',
'typeof document': '"undefined"',
'typeof navigator': '"undefined"',
'typeof location': '"undefined"',
'typeof XMLHttpRequest': '"undefined"'
'process.browser': false
},
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite/server'),
resolve: {
Expand Down Expand Up @@ -101,7 +97,14 @@ export async function buildServer (ctx: ViteBuildContext) {
},
plugins: [
jsxPlugin(),
vuePlugin
vuePlugin,
replace({
'typeof window': '"undefined"',
'typeof document': '"undefined"',
'typeof navigator': '"undefined"',
'typeof location': '"undefined"',
'typeof XMLHttpRequest': '"undefined"'
})
]
} as ViteOptions)

Expand Down
5 changes: 5 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export default defineNuxtConfig({
},
plugins: ['plugins/template.ts']
},
vite: {
build: {
assetsInlineLimit: 100 // keep SVG as assets URL
}
},
bridge: {
meta: true,
vite: !process.env.TEST_WITH_WEBPACK,
Expand Down
59 changes: 31 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0047f60

Please sign in to comment.