Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Provide option to post process styles #237

Closed
bnm12 opened this issue Oct 10, 2018 · 2 comments
Closed

Provide option to post process styles #237

bnm12 opened this issue Oct 10, 2018 · 2 comments

Comments

@bnm12
Copy link

bnm12 commented Oct 10, 2018

Hi :)
We have a business case which requires us to do some post processing of the output of rollup-plugin-vue and since we lack a plugin system I've had to make this fork to achieve our goal: https://github.com/bnm12/rollup-plugin-vue
unfortunately now we have to maintain a parallel implementation of this where we would much rather maintain a plugin which is not impacted by every code change here.
It also just feels plain wrong to have this very specific feature code inside rollup-plugin-vue - it feels more like a plugin kind of thing

@znck
Copy link
Member

znck commented Oct 23, 2018

I would prefer to use rollup's plugin system rather than re-inventing the wheel.

Could you provide some use cases (or reasons) for your fork?

@bnm12
Copy link
Author

bnm12 commented Oct 23, 2018

The specific use case here is that working with the new SharePoint framework (SPFX) if you want to use their theming capabilities you have to load all your css through a JS method called "loadStyles" (It goes in and does literal string replacement in your css it's quite silly, but there's not really anything we can do about it).
This means that what I need is something which lets me jump in after the .vue files have been parsed, so I can take the style section and convert to a line of script instead. But ideally before the finished parsing of the files so I don't have to try to "parse" the "compiled" code to split it again and combine as only script.

As far as I an tell the underlying mechanisms of this plugin only allows me to configure and supply a postCSS plugin, which will be very powerful, but still only works with the css, and I need one step above that to convert the css to script.

rollup-plugin-vue has the exact state I need: an object with template, script & css which all get combined to a final "compiled" output, so it only seemed natural to jump in there.

Hope this makes sense otherwise ask me to clarify more - this feels a bit rambly

@znck znck changed the title Feature request: plugins Provide option to post process styles Oct 24, 2018
@znck znck closed this as completed in 2ae1bbf Jan 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants