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

Emits "You did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing..." warning if scss entrypoint are passed to Webpack config #48

Open
bitfella opened this issue Nov 4, 2019 · 2 comments

Comments

@bitfella
Copy link
Contributor

bitfella commented Nov 4, 2019

Hello, postcss-crititical-css emits the following annoying console warning several times:

40% building 5/7 modules 2 active ...s\sass-loader\dist\cjs.js!C:\Migu\postcss-critical-css-test-master\src\module.scssYou did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. Pick plugins for your case on https://www.postcss.parts/ and use them in postcss.config.js.
40% building 7/8 modules 1 active ...s\sass-loader\dist\cjs.js!C:\Migu\postcss-critical-css-test-master\src\module.scssYou did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. Pick plugins for your case on https://www.postcss.parts/ and use them in postcss.config.js.

when scss (and css as well) entrypoints are passed to Webpack configuration object.
This happens when js entrypoints import css/scss files in which @critical rules are called.

Example:

module.exports = () => {
    return {
        entry: {
            main: path.join(__dirname, 'src', 'main.js'),
            site: path.join(__dirname, 'src', 'site.scss')
        },
        ...
    }
}

In this case, main.js imports main.scss that carries a @critical rule, while site.scss may or may not carry @critical rules (both ways will emit warnings).

Unfortunately I can't transform scss entrypoints into js ones and there's no way of silence warnings even playing with Webpack's stats options.

Thanks

@zgreen
Copy link
Owner

zgreen commented Dec 30, 2019

Thanks for the report, I'll take a look.

@timjuedemann
Copy link

I am encountering the same problem when running postcss-critical-css from within a CodeKit hook using postcss-cli.

I am importing scss files which are then compiled to a single css file using CodeKit’s libsass compiler. Said css file then serves as the entrypoint for my PostCSS plugin chain. However, any imported scss file carrying a @critical rule will result in the console warning mentioned by the OP. It’s worth noting that despite the warning everything compiles correctly.

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

3 participants