My Nuxt project doesn't pick up the config for postcss-import from nuxt.config.ts:
build: {
postcss: {
plugins: {
"postcss-import": {
path: ["../assets/css", "../components/@css", "../components"]
}
}
}
}
I get an error like Error: Can't resolve 'style.css' in /projectroot/pages
.
The same config in postcss.config.js
is picked up properly. To test, if I change postcss.config.js to point to non-existing directories, the error becomes: Error: Failed to find 'style.css' in [list of configured directories]
.
What should I do to get this working from nuxt.config.ts? Note that I'm using Typescript (nuxt-ts).
I had a file called postcssrc.js
I deleted it and in the file nuxt.config.js add the next code:
Then in the package.json I ran the scripts: