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

Empty output when using with cssnano #111

Open
alexa-infra opened this issue Jan 6, 2021 · 1 comment
Open

Empty output when using with cssnano #111

alexa-infra opened this issue Jan 6, 2021 · 1 comment

Comments

@alexa-infra
Copy link

Something goes wrong when using postcss-nested with cssnano in the postcss pipeline.

> cat no-bug.css
#hello {
  &.world {
    background-color: red;
  }
}
> cat no-bug.css | npx postcss -u postcss-nested --no-map | npx postcss -u cssnano --no-map && echo
#hello.world{background-color:red}
> cat no-bug.css | npx postcss -u postcss-nested -u cssnano --no-map && echo
#hello.world{background-color:red}
> cat bug.css
#hello {
  &.world {
    background-color: red;
    .bug {
      background-color: red;
    }
  }
}
> cat bug.css | npx postcss -u postcss-nested --no-map | npx postcss -u cssnano --no-map && echo
#hello.world,#hello.world .bug{background-color:red}
> cat bug.css | npx postcss -u postcss-nested -u cssnano --no-map && echo

Note the last command produces no output, but the previous command works as expected.

To summarize, if I use raw output from postcss-nested and pass it to cssnano, then it works as expected; if I use both postcss-nested with cssnano in the postcss pipeline, then it produces no output from that buggy file.

"cssnano": "^4.1.10",
"postcss": "^8.2.2",
"postcss-nested": "^5.0.3",

Not sure if it's a bug in postcss-nested, but it has appeared after upgrading from postcss-nested 4.1.2 and postcss 7.0.0 (cssnano version hasn't changed)

@ai
Copy link
Member

ai commented Jan 6, 2021

Sorry. I will not have time in a few next weeks. PR is welcome.

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

2 participants