mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-23 18:10:26 +08:00
fix(tailwind): dynamically import Tailwind CSS in Vite config
- Updated the Electron Vite configuration to dynamically import Tailwind CSS for improved performance. - Removed the direct import of Tailwind CSS from the plugins array to streamline the build process.
This commit is contained in:
parent
8429e678bc
commit
a830d05790
@ -1,4 +1,3 @@
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import react from '@vitejs/plugin-react-swc'
|
||||
import { CodeInspectorPlugin } from 'code-inspector-plugin'
|
||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
||||
@ -81,6 +80,7 @@ export default defineConfig({
|
||||
},
|
||||
renderer: {
|
||||
plugins: [
|
||||
(async () => (await import('@tailwindcss/vite')).default())(),
|
||||
react({
|
||||
tsDecorators: true,
|
||||
plugins: [
|
||||
@ -96,8 +96,7 @@ export default defineConfig({
|
||||
]
|
||||
}),
|
||||
...(isDev ? [CodeInspectorPlugin({ bundler: 'vite' })] : []), // 只在开发环境下启用 CodeInspectorPlugin
|
||||
...visualizerPlugin('renderer'),
|
||||
tailwindcss()
|
||||
...visualizerPlugin('renderer')
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user