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

What is the correct way to handle css preprocessor? #550

Closed
kendrickw opened this issue Jan 24, 2019 · 4 comments · Fixed by #551
Closed

What is the correct way to handle css preprocessor? #550

kendrickw opened this issue Jan 24, 2019 · 4 comments · Fixed by #551

Comments

@kendrickw
Copy link

How can I incorporate css preprocessor into this plugin? (I'm using packages/rollup).

For example, one of the css imports a stylus sheet (i.e. abc.styl). Can I insert a stylus loader into the plugin, and have it transform the content of abc.styl into css, before having the plugin take over?

@tivac
Copy link
Owner

tivac commented Jan 24, 2019

If there's a post CSS plugin for stylus you can add that to the before hook to have it transform that file into CSS.

@kendrickw
Copy link
Author

There isn't a postcss-stylus, unfortunately. But I suppose I can build one.
For these type of preprocessors (i.e. https://github.com/postcss/sugarss), they are not postcss plugins per se, and the invocation looks like:

 postcss(plugins, { parser: sugarss })

How would something like sugarss fit into the before hook?

@tivac
Copy link
Owner

tivac commented Jan 24, 2019

Looks like https://github.com/Avol-V/postcss-stylus-parser is a thing that exists, but I don't think I expose a way to define the postcss parser value atm. I'll see what I can do to pipe that in.

@tivac
Copy link
Owner

tivac commented Jan 24, 2019

Fix published in v21.2.0, you can pass a postcss : { parser : ... } option for parsing custom syntaxes.

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

Successfully merging a pull request may close this issue.

2 participants