@@ -52,6 +52,7 @@ export type PluginOptions = {
52
52
function tailwindcss ( opts : PluginOptions = { } ) : AcceptedPlugin {
53
53
let base = opts . base ?? process . cwd ( )
54
54
let optimize = opts . optimize ?? process . env . NODE_ENV === 'production'
55
+ console . log ( { opts, flag : process . env . NODE_ENV } )
55
56
56
57
return {
57
58
postcssPlugin : '@tailwindcss/postcss' ,
@@ -319,13 +320,13 @@ function optimizeCss(
319
320
nonStandard : {
320
321
deepSelectorCombinator : true ,
321
322
} ,
322
- include : LightningCssFeatures . Nesting ,
323
+ include : LightningCssFeatures . Nesting | LightningCssFeatures . MediaRangeSyntax ,
323
324
exclude :
324
325
LightningCssFeatures . LogicalProperties |
325
326
LightningCssFeatures . DirSelector |
326
327
LightningCssFeatures . LightDark ,
327
328
targets : {
328
- safari : ( 16 << 16 ) | ( 4 << 8 ) ,
329
+ safari : ( 15 << 16 ) | ( 4 << 8 ) ,
329
330
ios_saf : ( 16 << 16 ) | ( 4 << 8 ) ,
330
331
firefox : 128 << 16 ,
331
332
chrome : 111 << 16 ,
@@ -334,9 +335,14 @@ function optimizeCss(
334
335
} ) . code
335
336
}
336
337
338
+ let out = optimize ( optimize ( Buffer . from ( input ) ) ) . toString ( )
339
+ console . log ( { out } )
340
+
341
+ out = out . replaceAll ( / \@ m e d i a ( \( ) ? n o t / g, '@media $1not all and ' )
342
+
337
343
// Running Lightning CSS twice to ensure that adjacent rules are merged after
338
344
// nesting is applied. This creates a more optimized output.
339
- return optimize ( optimize ( Buffer . from ( input ) ) ) . toString ( )
345
+ return out
340
346
}
341
347
342
348
export default Object . assign ( tailwindcss , { postcss : true } ) as PluginCreator < PluginOptions >
0 commit comments