Skip to content

Commit

Permalink
support nuxt 2.16+
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll authored Feb 9, 2023
1 parent bc9776b commit 08436e5
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 08436e5

Please sign in to comment.