Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to disable postcss-calc in production #2667

Closed
dangelion opened this issue Apr 7, 2021 · 1 comment
Closed

Impossible to disable postcss-calc in production #2667

dangelion opened this issue Apr 7, 2021 · 1 comment

Comments

@dangelion
Copy link

I have to disable postcss-calc because in production makes wrong calc (see the reported bugs at the end).
That library, I think, is used by cssnano.
In Sage 9 I did this adding calc: false in postcss.config.js file:

const cssnanoConfig = {
  preset: ['default', { discardComments: { removeAll: true }, calc: false }],
};

module.exports = ({ file, options }) => {
  return {
    parser: options.enabled.optimize ? 'postcss-safe-parser' : undefined,
    plugins: {
      autoprefixer: true,
      cssnano: options.enabled.optimize ? cssnanoConfig : false,
    },
  };
};

Tried also this:

mix
  .sass('resources/styles/app.scss', 'styles')
  .sass('resources/styles/editor.scss', 'styles')
  .options({
    postCss: [
      require('cssnano')({
        preset: ['default', {discardComments: {removeAll: true}, calc: false}],
      }),
    ],
    processCssUrls: false,
  });

No solutions work and give no error!
How can do that?

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

postcss/postcss-calc#115
postcss/postcss-calc#107
postcss/postcss-calc#91
postcss/postcss-calc#77
postcss/postcss-calc#116
NMFR/optimize-css-assets-webpack-plugin#110
cssnano/cssnano#628

@github-actions
Copy link

github-actions bot commented Apr 7, 2021

Hi @dangelion,
It looks like the issue template is missing from this issue. Please take a look at the Contribution Guidelines, which will tell you exactly what your ticket has to contain in order to be processable.
Please do not use the issue tracker for personal support requests. Use Roots Discourse to ask the Roots community for help, or hire someone from the community.

@github-actions github-actions bot closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant