Next.js Discord

Discord Forum

postcss.config

Answered
Raspberry Horntail posted this in #help-forum
Open in Discord
Raspberry HorntailOP
Is next js has build in postcss support? I am need to write this in commonjs?
trying this config
import postCssPresetEnvPlugin from "postcss-preset-env";
import autoprefixer from "autoprefixer";
/** @type {import('postcss').ProcessOptions} */

const config = {
  plugins: [postCssPresetEnvPlugin({}), autoprefixer({})],
};

export default config;

error:
import postCssPresetEnvPlugin from "postcss-preset-env";
Answered by Raspberry Horntail
i change ext to mjs. and write this and everything seems fine
/** @type {import('postcss').ProcessOptions} */

const config = {
  plugins: ["autoprefixer", "postcss-preset-env"],
};

export default config;
View full answer

1 Reply

Raspberry HorntailOP
i change ext to mjs. and write this and everything seems fine
/** @type {import('postcss').ProcessOptions} */

const config = {
  plugins: ["autoprefixer", "postcss-preset-env"],
};

export default config;
Answer