mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 22:10:21 +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 react from '@vitejs/plugin-react-swc'
|
||||||
import { CodeInspectorPlugin } from 'code-inspector-plugin'
|
import { CodeInspectorPlugin } from 'code-inspector-plugin'
|
||||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
||||||
@ -81,6 +80,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
renderer: {
|
renderer: {
|
||||||
plugins: [
|
plugins: [
|
||||||
|
(async () => (await import('@tailwindcss/vite')).default())(),
|
||||||
react({
|
react({
|
||||||
tsDecorators: true,
|
tsDecorators: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
@ -96,8 +96,7 @@ export default defineConfig({
|
|||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
...(isDev ? [CodeInspectorPlugin({ bundler: 'vite' })] : []), // 只在开发环境下启用 CodeInspectorPlugin
|
...(isDev ? [CodeInspectorPlugin({ bundler: 'vite' })] : []), // 只在开发环境下启用 CodeInspectorPlugin
|
||||||
...visualizerPlugin('renderer'),
|
...visualizerPlugin('renderer')
|
||||||
tailwindcss()
|
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user