Skip to content
Permalink
Browse files
feat: support vite 3.1
  • Loading branch information
antfu committed Sep 18, 2022
1 parent 6d09ebd commit 16c8c557e73994c53a00591b34775336b09a9e91
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 276 deletions.
@@ -99,7 +99,7 @@
"unocss": "workspace:*",
"unplugin-auto-import": "^0.11.2",
"unplugin-vue-components": "^0.22.7",
"vite": "3.1.0",
"vite": "^3.1.2",
"vite-plugin-inspect": "^0.7.1",
"vite-plugin-pages": "^0.26.0",
"vitest": "^0.23.4",
@@ -109,7 +109,7 @@
"pnpm": {
"overrides": {
"@nuxt/kit-edge": "npm:@nuxt/kit@latest",
"vite": "3.0.9"
"vite": "^3.1.2"
}
},
"simple-git-hooks": {
@@ -125,7 +125,10 @@ export function GlobalModeBuildPlugin({ uno, ready, extract, tokens, filter, get
css = await applyCssTransform(css, fakeCssId, options.dir)

const hash = getHash(css)
await cssPost.transform!.call({} as any, getHashPlaceholder(hash), fakeCssId)
const transformHandler = 'handler' in cssPost.transform!
? cssPost.transform.handler
: cssPost.transform!
await transformHandler.call({} as any, getHashPlaceholder(hash), fakeCssId)

// fool the css plugin to generate the css in corresponding chunk
chunk.modules[fakeCssId] = {
@@ -124,6 +124,7 @@ declare global {
const useCeil: typeof import('@vueuse/math')['useCeil']
const useClamp: typeof import('@vueuse/math')['useClamp']
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useCloned: typeof import('@vueuse/core')['useCloned']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
const useCounter: typeof import('@vueuse/core')['useCounter']
@@ -201,6 +202,7 @@ declare global {
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
const usePrecision: typeof import('@vueuse/math')['usePrecision']
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']

0 comments on commit 16c8c55

Please sign in to comment.