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

Proposal: attach processing to OnceExit hook #39

Open
bart-jaskulski opened this issue Nov 15, 2021 · 0 comments
Open

Proposal: attach processing to OnceExit hook #39

bart-jaskulski opened this issue Nov 15, 2021 · 0 comments

Comments

@bart-jaskulski
Copy link

Right now processing exported files is done by reapplying plugins to extracted files, but I could be possible just to rely on the order of execution, and thus putting postcss-extract-media-query as the last plugin in stack, after processing by other plugins.

Attaching to OnceExit postcss hook (instead of Once) ensures that the plugin code is executed at the end.

module.exports = {
  plugins = [
    require('cssnano'),
    require('postcss-extract-media-query')({
      output: { path: './' }
    })
  ]
}

Config above would firstly minify our css file, then extract it to separate files, with processing applied. At the moment it is possible only by attaching additional config to in plugin settings, which specifies that we want to minify our files.

The change, I mention would take care of such processing mostly out of the box, but it would possibly be a breaking change, because it would require a correct order of declaring plugins in postcss.config.js

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