'How to configure postcss in webpack from Symfony with the plugin postcss increasing textsizes?

I want to use the plugin https://github.com/iamfrntdv/postcss-increase-text-sizes to make my fonts larger in the whole css and spit it out into a separate file. That's why I want to use postCss with webpack in Symfony.

I configure it as follows:

  1. in the webpack.config.js file he writes .enablePostCssLoader()
  2. I create the postcss.config.js file with the following configuration
module.exports = {
    from: './web/assets/src/css/custom.css',
    output: './output.css',
    plugins: [
        require("postcss-increase-text-sizes")({
            fontSizeMultiplyBy: 1.2,
            lineheightMultiplyBy: 1.2,
            selectorsBlackList: ["h2"]
        }),
    ],
};
  1. Unfortunately, I do not get anything in the "output", no file named output.css is created after reloading encore with npm run watch or npm run build

Webpack does not report the error that it "does not see" the file even if you type "test test" in the from: directive.

Instead, it throws an error if there is something "wrong" (eg a syntax error) in the postcss.config.js file.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source