PostCSS global/local

When going from resources.PostCSS (dict "use" "autoprefixer")
to resources.PostCSS + postcss.config.js

module.exports = {
  plugins: [
    require('autoprefixer')
  ]
}

I have an error:

Error: Error building site: POSTCSS: failed to transform "scss/app.css" (text/css): resource "scss/scss/app.scss_832876c32a71faa43531d9a08ead6e38" not found in file cache

When installing autoprefixer and postcss locally (while keeping them installed globally + postcss-cli), it solves the problem.
I made tests while deleting resources each time to not be fooled by caching.

Is this behavior “normal”?
The docs doesn’t mention to install postcss + autoprefixer locally if we use a postcss.config.js instead of (dict "use" "autoprefixer").

I am pretty sure, the documentation says somewhere to have ALL either global or local installed. That is possibly the issue here. autoprefixer, postcss and postcss-cli should be installed either local or global.

1 Like