Search code examples
node.jsnpmwebpackconfigurationpostcss

Can I setup PostCSS Preset Env in package.json?


I want to use PostCSS Preset Env in my project. In the documentation it says I need to write a config file. Is it possible to instead of writing a config file have the configuration in my package.json?

In this other project it shows as this might be possible.


Solution

  • I tried, and it works.

    Example in package.json:

      "browserslist": [
        "defaults"
      ],
      "postcss": {
        "plugins": {
          "postcss-preset-env": {
            "stage": 0
          }
        }
      }