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

Comments

Projects
None yet
2 participants
@kendrickw
Copy link

commented Jan 24, 2019

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Author

commented Jan 24, 2019

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

This comment has been minimized.

Copy link
Owner

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 tivac referenced this issue Jan 24, 2019

Merged

feat: support postcss process options #551

7 of 9 tasks complete

@tivac tivac closed this in #551 Jan 24, 2019

tivac added a commit that referenced this issue Jan 24, 2019

@tivac

This comment has been minimized.

Copy link
Owner

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
You can’t perform that action at this time.