chore: bump vite

pull/200/head
Evan You 4 years ago
parent 161e0ea69c
commit 6ff76c4ea8

@ -88,7 +88,7 @@
"prismjs": "^1.20.0",
"sirv": "^1.0.10",
"slash": "^3.0.0",
"vite": "^2.0.0-beta.6",
"vite": "^2.0.0-beta.7",
"vue": "^3.0.5"
},
"devDependencies": {

@ -7,7 +7,7 @@ export function useUpdateHead(route: Route, siteDataByRouteRef: Ref<SiteData>) {
let isFirstUpdate = true
const updateHeadTags = (newTags: HeadConfig[]) => {
if (process.env.NODE_ENV === 'production' && isFirstUpdate) {
if (import.meta.env.PROD && isFirstUpdate) {
// in production, the initial meta tags are already pre-rendered so we
// skip the first update.
isFirstUpdate = false

@ -54,7 +54,7 @@ export function createApp() {
}
function newApp(): App {
return process.env.NODE_ENV === 'production'
return import.meta.env.PROD
? createSSRApp(VitePressApp)
: createClientApp(VitePressApp)
}
@ -85,6 +85,7 @@ function newRouter(): Router {
}
// SSR: sync require
// @ts-ignore
return require(pageFilePath)
}, NotFound)
}

@ -65,13 +65,11 @@ export function mixinGlobalComputed(
}
export function mixinGlobalComponents(app: App) {
const isProd = process.env.NODE_ENV === 'production'
app.component('Content', Content)
app.component('ClientOnly', ClientOnly)
app.component(
'Debug',
isProd
import.meta.env.PROD
? () => null
: defineAsyncComponent(() => import('./components/Debug.vue'))
)

@ -1 +0,0 @@
import 'vite/env'

@ -113,7 +113,7 @@ function isAnchorActive(
}
function throttleAndDebounce(fn: () => void, delay: number): () => void {
let timeout: NodeJS.Timeout
let timeout: number
let called = false
return () => {

@ -6,7 +6,7 @@
"target": "esnext",
"module": "esnext",
"lib": ["ESNext", "DOM"],
"types": ["vite"],
"types": ["vite/client"],
"paths": {
"/@shared/*": ["shared/*"],
"/@types/*": ["../../types/*"],

@ -6031,10 +6031,10 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"
vite@^2.0.0-beta.6:
version "2.0.0-beta.6"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.6.tgz#8f62e05027b0dbbcc9640c7e641b1f9a39310b62"
integrity sha512-VtzB5X5XUUNWBTnOrdsi6pqBj7V/95kJ2GmcVTdfnnmN1KzShEW2NH1e210adXiuuPn4wtGShg4ruIuq02Evzg==
vite@^2.0.0-beta.7:
version "2.0.0-beta.7"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.7.tgz#8200198ac3c0a5e9deb62579e01053cea89d6176"
integrity sha512-9tkmaq4PbBDWmcvIto07jpkMiD084EgDsizZxijYrpS3ojC9myksA/hlKA7RzK+uSEFetcb1ZY4ONpJQb/J+vw==
dependencies:
esbuild "^0.8.26"
postcss "^8.2.1"

Loading…
Cancel
Save