File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/@tailwindcss-vite/src Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export type PluginOptions = {
2929export default function tailwindcss ( opts : PluginOptions = { } ) : Plugin [ ] {
3030 let servers : ViteDevServer [ ] = [ ]
3131 let config : ResolvedConfig | null = null
32- let roots = new Map < string , Root > ( )
32+ let rootsByEnv = new DefaultMap < string , Map < string , Root > > ( ( env : string ) => new Map ( ) )
3333
3434 let isSSR = false
3535 let shouldOptimize = true
@@ -134,6 +134,7 @@ export default function tailwindcss(opts: PluginOptions = {}): Plugin[] {
134134 using I = new Instrumentation ( )
135135 DEBUG && I . start ( '[@tailwindcss/vite] Generate CSS (serve)' )
136136
137+ let roots = rootsByEnv . get ( this . environment ?. name ?? 'default' )
137138 let root = roots . get ( id )
138139 if ( ! root ) {
139140 root ??= createRoot ( this . environment ?? null , id )
@@ -170,6 +171,7 @@ export default function tailwindcss(opts: PluginOptions = {}): Plugin[] {
170171 using I = new Instrumentation ( )
171172 DEBUG && I . start ( '[@tailwindcss/vite] Generate CSS (build)' )
172173
174+ let roots = rootsByEnv . get ( this . environment ?. name ?? 'default' )
173175 let root = roots . get ( id )
174176 if ( ! root ) {
175177 root ??= createRoot ( this . environment ?? null , id )
You can’t perform that action at this time.
0 commit comments