File tree 2 files changed +788
-1395
lines changed
2 files changed +788
-1395
lines changed Original file line number Diff line number Diff line change @@ -94,20 +94,16 @@ export default defineNuxtModule({
94
94
95
95
// Setup postcss plugins
96
96
// https://tailwindcss.com/docs/using-with-preprocessors#future-css-features
97
- const postcssPlugins = {
98
- 'postcss-nesting' : { } ,
99
- 'postcss-custom-properties' : { } ,
100
- tailwindcss : tailwindConfig
101
- }
97
+ const postcssOptions =
98
+ nuxt . options . postcss || /* nuxt 3 */
99
+ nuxt . options . build . postcss . postcssOptions || /* older nuxt3 */
100
+ nuxt . options . build . postcss as any
101
+ postcssOptions . plugins [ 'tailwindcss/nesting' ] = postcssOptions . plugins [ 'tailwindcss/nesting' ] ?? { }
102
+ postcssOptions . plugins [ 'postcss-custom-properties' ] = postcssOptions . plugins [ 'postcss-custom-properties' ] ?? { }
103
+ postcssOptions . plugins . tailwindcss = tailwindConfig
102
104
103
105
if ( isNuxt2 ( ) ) {
104
- const postcssOptions = nuxt . options . build . postcss as any
105
- postcssOptions . plugins = defu ( postcssOptions . plugins , postcssPlugins )
106
106
await installModule ( '@nuxt/postcss8' )
107
- } else {
108
- const postcssOptions = nuxt . options . build . postcss . postcssOptions
109
- postcssOptions . plugins = postcssOptions . plugins || { }
110
- postcssOptions . plugins = defu ( postcssOptions . plugins , postcssPlugins )
111
107
}
112
108
113
109
// Add _tailwind config viewer endpoint
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments