I have no errors.
cssnano and postcss-calc are in the yarn.lock so I think they’re used. I have to set “calc: false” that is the way cssnano uses to set the dependency postcss-calc to false.
I tried postcss.config.js but it doesn’t work and I have no errors
I noticed that my code works with yarn build but only in yarn build:production doesn’t works
Doesn’t work for production builds means that the transformations by postcss-calc are not applied to the production CSS file? Maybe the CSS minifier cssnano interferes with the result?
Do the applied production styles look the same in the browser (visually)?
Can you disable cssnano for the production build to exclude it as a possible cause?
Same problem here.
I have to disable postcss-calc because in production makes wrong calc (see the reported bug below). In Sage 9 I did it as @sirdoy said but in Sage 10 I can’t. How can do the same?
Or how can remove postcss-calc at all from Sage 10?
Bug: cssnano → postcss-calc compiling in production
doesn’t keep parenthesis inside some calc() with css variables
You can dump the whole generated webpack configuration object and find out where exactly postcss-calc is added/kept by Laravel Mix. Then you can use a Laravel Mix hook/method to remove it from the configuration object.