Skip to content

Commit 0c5e073

Browse files
authoredFeb 11, 2023
fix: support nuxt 2.16+ (#611)
fixes #609
1 parent bc9776b commit 0c5e073

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/module.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
addTemplate,
1111
addDevServerHandler,
1212
isNuxt2,
13+
getNuxtVersion,
1314
createResolver,
1415
resolvePath,
1516
addVitePlugin,
@@ -269,7 +270,11 @@ export default defineNuxtModule<ModuleOptions>({
269270
postcssOptions.plugins['postcss-custom-properties'] = postcssOptions.plugins['postcss-custom-properties'] ?? {}
270271
postcssOptions.plugins.tailwindcss = tailwindConfig
271272

272-
if (isNuxt2()) {
273+
/*
274+
* install postcss8 module on nuxt < 2.16
275+
*/
276+
const nuxtVersion = getNuxtVersion(nuxt).split('.');
277+
if (parseInt(nuxtVersion[0], 10) === 2 && parseInt(nuxtVersion[1], 10) < 16) {
273278
await installModule('@nuxt/postcss8')
274279
}
275280

0 commit comments

Comments
 (0)