Skip to content

Commit

Permalink
chore: bump vite
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 5, 2021
1 parent 161e0ea commit 6ff76c4
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/composables/head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/client/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -85,6 +85,7 @@ function newRouter(): Router {
}

// SSR: sync require
// @ts-ignore
return require(pageFilePath)
}, NotFound)
}
Expand Down
4 changes: 1 addition & 3 deletions src/client/app/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
)
Expand Down
1 change: 0 additions & 1 deletion src/client/env.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/client/theme-default/composables/activeSidebarLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function isAnchorActive(
}

function throttleAndDebounce(fn: () => void, delay: number): () => void {
let timeout: NodeJS.Timeout
let timeout: number
let called = false

return () => {
Expand Down
2 changes: 1 addition & 1 deletion src/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"target": "esnext",
"module": "esnext",
"lib": ["ESNext", "DOM"],
"types": ["vite"],
"types": ["vite/client"],
"paths": {
"/@shared/*": ["shared/*"],
"/@types/*": ["../../types/*"],
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6ff76c4

Please sign in to comment.