bump: update for tailwindcss 4.0

This commit is contained in:
2025-02-16 02:28:12 +08:00
parent 1363b87f36
commit c1812a7f09
14 changed files with 362 additions and 89 deletions

View File

@@ -1,9 +1,8 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
import path from 'path';
import nesting from 'tailwindcss/nesting';
import tailwindcss from '@tailwindcss/vite';
const isDev = process.env.NODE_ENV === 'development';
const isKV = process.env.VITE_USE_KV === 'true'; // use kevisual service as backend
const unamiPlugin = {
@@ -19,6 +18,7 @@ const plugins = [];
if (!isDev) {
plugins.push(unamiPlugin);
}
plugins.push(tailwindcss());
let proxy = {};
if (isKV) {
proxy = {
@@ -46,19 +46,7 @@ export default defineConfig({
plugins: [react(), ...plugins],
css: {
postcss: {
// @ts-ignore
plugins: [
nesting({
// 兼容 tailwindcss 4.0
tailwindcss: {
config: './tailwind.config.js',
},
}),
tailwindcss,
autoprefixer,
],
},
postcss: {},
},
resolve: {
alias: {