Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Vite 4 support #1982

Merged
merged 3 commits into from Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions bench/package.json
Expand Up @@ -4,14 +4,14 @@
},
"devDependencies": {
"@unocss/vite": "workspace:*",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue": "^4.0.0",
"autoprefixer": "^10.4.13",
"fs-extra": "^11.0.0",
"local-pkg": "^0.4.2",
"postcss": "^8.4.19",
"tailwindcss": "^3.2.4",
"unocss": "workspace:*",
"vite": "^3.2.4",
"vite": "^4.0.0",
"vite-plugin-windicss": "^1.8.8",
"vue": "^3.2.39",
"windicss": "^3.5.6"
Expand Down
2 changes: 1 addition & 1 deletion examples/qwik/package.json
Expand Up @@ -19,6 +19,6 @@
"@unocss/reset": "link:../../packages/reset",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "3.2.4"
"vite": "4.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/sveltekit-scoped/package.json
Expand Up @@ -22,7 +22,7 @@
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4"
"vite": "^4.0.0"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/sveltekit/package.json
Expand Up @@ -22,7 +22,7 @@
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "3.2.4"
"vite": "4.0.0"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-elm/package.json
Expand Up @@ -16,7 +16,7 @@
"@unocss/preset-uno": "link:../../packages/preset-uno",
"elm-tooling": "^1.10.0",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4",
"vite": "^4.0.0",
"vite-plugin-elm": "^2.7.2"
}
}
2 changes: 1 addition & 1 deletion examples/vite-lit/package.json
Expand Up @@ -24,7 +24,7 @@
"@unocss/preset-icons": "link:../../packages/preset-icons",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4",
"vite": "^4.0.0",
"vite-plugin-inspect": "^0.7.9"
}
}
2 changes: 1 addition & 1 deletion examples/vite-preact/package.json
Expand Up @@ -21,6 +21,6 @@
"cross-env": "^7.0.3",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4"
"vite": "^4.0.0"
}
}
4 changes: 2 additions & 2 deletions examples/vite-react/package.json
Expand Up @@ -19,10 +19,10 @@
"@unocss/core": "link:../../packages/core",
"@unocss/preset-attributify": "link:../../packages/preset-attributify",
"@unocss/preset-icons": "link:../../packages/preset-icons",
"@vitejs/plugin-react": "^2.2.0",
"@vitejs/plugin-react": "^3.0.0",
"cross-env": "^7.0.3",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4"
"vite": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/vite-solid/package.json
Expand Up @@ -17,7 +17,7 @@
"@unocss/preset-icons": "link:../../packages/preset-icons",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4",
"vite": "^4.0.0",
"vite-plugin-solid": "^2.4.0"
}
}
4 changes: 2 additions & 2 deletions examples/vite-svelte/package.json
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@iconify-json/logos": "^1.1.19",
"@sveltejs/vite-plugin-svelte": "^1.3.1",
"@sveltejs/vite-plugin-svelte": "^2.0.0",
"@tsconfig/svelte": "^3.0.0",
"@unocss/core": "link:../../packages/core",
"@unocss/preset-icons": "link:../../packages/preset-icons",
Expand All @@ -20,6 +20,6 @@
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4"
"vite": "^4.0.0"
}
}
4 changes: 2 additions & 2 deletions examples/vite-vue3/package.json
Expand Up @@ -14,9 +14,9 @@
"@unocss/core": "link:../../packages/core",
"@unocss/preset-attributify": "link:../../packages/preset-attributify",
"@unocss/preset-icons": "link:../../packages/preset-icons",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue": "^4.0.0",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4"
"vite": "^4.0.0"
}
}
4 changes: 2 additions & 2 deletions examples/vite-watch-mode/package.json
Expand Up @@ -17,10 +17,10 @@
"@unocss/core": "link:../../packages/core",
"@unocss/preset-attributify": "link:../../packages/preset-attributify",
"@unocss/preset-icons": "link:../../packages/preset-icons",
"@vitejs/plugin-react": "^2.2.0",
"@vitejs/plugin-react": "^3.0.0",
"cross-env": "^7.0.3",
"typescript": "^4.9.3",
"unocss": "link:../../packages/unocss",
"vite": "^3.2.4"
"vite": "^4.0.0"
}
}
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -67,7 +67,7 @@
"@unocss/transformer-variant-group": "workspace:*",
"@unocss/vite": "workspace:*",
"@unocss/webpack": "workspace:*",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue": "^4.0.0",
"@vitest/ui": "^0.25.3",
"@vueuse/core": "^9.6.0",
"@vueuse/math": "^9.6.0",
Expand All @@ -91,7 +91,7 @@
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"react": "^18.2.0",
"rollup": "^2.79.1",
"rollup": "^3.7.2",
"semver": "^7.3.8",
"simple-git-hooks": "^2.8.1",
"splitpanes": "^3.1.5",
Expand All @@ -102,7 +102,7 @@
"unocss": "workspace:*",
"unplugin-auto-import": "^0.12.0",
"unplugin-vue-components": "^0.22.11",
"vite": "^3.2.4",
"vite": "^4.0.0",
"vite-plugin-inspect": "^0.7.9",
"vite-plugin-pages": "^0.27.1",
"vitest": "^0.25.3",
Expand All @@ -112,7 +112,7 @@
"pnpm": {
"overrides": {
"@nuxt/kit-edge": "npm:@nuxt/kit@latest",
"vite": "^3.1.6",
"vite": "^4.0.0",
"nuxt": "^3.0.0"
}
},
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/package.json
Expand Up @@ -43,7 +43,7 @@
"stub": "unbuild --stub"
},
"peerDependencies": {
"vite": "^2.9.0 || ^3.0.0-0"
"vite": "^2.9.0 || ^3.0.0-0 || ^4.0.0"
},
"dependencies": {
"@ampproject/remapping": "^2.2.0",
Expand All @@ -53,10 +53,10 @@
"@unocss/inspector": "workspace:*",
"@unocss/scope": "workspace:*",
"@unocss/transformer-directives": "workspace:*",
"magic-string": "^0.26.7"
"magic-string": "^0.27.0"
},
"devDependencies": {
"@unocss/shared-integration": "workspace:*",
"vite": "^3.2.4"
"vite": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/vite/src/modes/global/build.ts
Expand Up @@ -241,7 +241,7 @@ export function GlobalModeBuildPlugin({ uno, ready, extract, tokens, filter, get
msg += '\nIt seems you are building in library mode, it\'s recommended to set `build.cssCodeSplit` to true.\nSee https://github.com/vitejs/vite/issues/1579'
else
msg += '\nThis is likely an internal bug of unocss vite plugin'
this.error(new Error(msg))
this.error(msg)
}
},
},
Expand Down