nuxt 3 postcss

The solution for “nuxt 3 postcss” can be found here. The following code will assist you in solving the problem.

// install dependencies (example)
yarn add postcss postcss-calc postcss-flexbugs-fixes postcss-import postcss-preset-env -D

// postcss.config.js
module.exports = {
plugins: {
“postcss-import”: {},
autoprefixer: {},
“postcss-flexbugs-fixes”: {},
“postcss-preset-env”: {
autoprefixer: {
flexbox: “no-2009”,
grid: “autoplace”,
},
stage: 3,
features: {
“custom-properties”: false,
},
},
“postcss-calc”: {
precision: 10,
selectors: true,
mediaQueries: true,
preserve: true,
},
cssnano: {
preset: “default”,
},
},
}

// nuxt.config.ts
export default defineNuxtConfig({
build: {
postcss: {
postcssOptions: require(“./postcss.config.js”),
},
},
})

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in