Skip to content

Commit

Permalink
fix: support nuxt 2.16+ (#611)
Browse files Browse the repository at this point in the history
fixes #609
  • Loading branch information
simllll committed Feb 11, 2023
1 parent bc9776b commit 0c5e073
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
addTemplate,
addDevServerHandler,
isNuxt2,
getNuxtVersion,
createResolver,
resolvePath,
addVitePlugin,
Expand Down Expand Up @@ -269,7 +270,11 @@ export default defineNuxtModule<ModuleOptions>({
postcssOptions.plugins['postcss-custom-properties'] = postcssOptions.plugins['postcss-custom-properties'] ?? {}
postcssOptions.plugins.tailwindcss = tailwindConfig

if (isNuxt2()) {
/*
* install postcss8 module on nuxt < 2.16
*/
const nuxtVersion = getNuxtVersion(nuxt).split('.');
if (parseInt(nuxtVersion[0], 10) === 2 && parseInt(nuxtVersion[1], 10) < 16) {
await installModule('@nuxt/postcss8')
}

Expand Down

0 comments on commit 0c5e073

Please sign in to comment.