File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed
redisinsight/ui/src/packages Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ import react from '@vitejs/plugin-react';
4
4
import svgr from 'vite-plugin-svgr' ;
5
5
import { ViteEjsPlugin } from 'vite-plugin-ejs' ;
6
6
import { viteStaticCopy } from 'vite-plugin-static-copy' ;
7
- import { resolve } from 'path' ;
8
- import { fileURLToPath } from 'url' ;
7
+ import path , { resolve } from 'path'
8
+ import { fileURLToPath } from 'url'
9
9
10
10
const riPlugins = [
11
11
{ name : 'redisearch' , entry : 'src/main.tsx' } ,
@@ -83,6 +83,32 @@ export default defineConfig({
83
83
this : 'window' ,
84
84
} ,
85
85
} ,
86
+ css : {
87
+ preprocessorOptions : {
88
+ scss : {
89
+ // add @layer app for css ordering. Styles without layer have the highest priority
90
+ // https://github.com/vitejs/vite/issues/3924
91
+ additionalData : ( source , filename ) => {
92
+ if ( path . extname ( filename ) === '.scss' ) {
93
+ const skipFiles = [
94
+ '/main.scss' ,
95
+ '/App.scss' ,
96
+ '/packages/clients-list/src/styles/styles.scss' ,
97
+ '/packages/redisearch/src/styles/styles.scss'
98
+ ] ;
99
+ if ( skipFiles . every ( ( file ) => ! filename . endsWith ( file ) ) ) {
100
+ return `
101
+ @use "uiSrc/styles/mixins/_eui.scss";
102
+ @use "uiSrc/styles/mixins/_global.scss";
103
+ @layer app { ${ source } }
104
+ ` ;
105
+ }
106
+ }
107
+ return source ;
108
+ } ,
109
+ } ,
110
+ } ,
111
+ } ,
86
112
define : {
87
113
global : 'globalThis' ,
88
114
'process.env' : { } ,
You can’t perform that action at this time.
0 commit comments