Skip to content

Commit

Permalink
chore: assign postcss plugins in order
Browse files Browse the repository at this point in the history
  • Loading branch information
ineshbose committed Feb 8, 2024
1 parent 2e276b6 commit 46c2025
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@ export default defineNuxtModule<ModuleOptions>({
nuxt.options.postcss || /* nuxt 3 */ /* @ts-ignore */
nuxt.options.build.postcss.postcssOptions || /* older nuxt3 */ /* @ts-ignore */
nuxt.options.build.postcss as any
postcssOptions.plugins = postcssOptions.plugins || {}
postcssOptions.plugins['tailwindcss/nesting'] = postcssOptions.plugins['tailwindcss/nesting'] ?? {}
postcssOptions.plugins['postcss-custom-properties'] = postcssOptions.plugins['postcss-custom-properties'] ?? {}
postcssOptions.plugins.tailwindcss = tailwindConfig
postcssOptions.plugins = {
...(postcssOptions.plugins || {}),
'tailwindcss/nesting': postcssOptions.plugins['tailwindcss/nesting'] ?? {},
'postcss-custom-properties': postcssOptions.plugins['postcss-custom-properties'] ?? {},
tailwindcss: tailwindConfig
}

// install postcss8 module on nuxt < 2.16
if (parseFloat(getNuxtVersion()) < 2.16) {
Expand Down

0 comments on commit 46c2025

Please sign in to comment.