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

Extract SCSS instead of compiling #299

Open
7studio opened this issue Oct 8, 2019 · 5 comments
Open

Extract SCSS instead of compiling #299

7studio opened this issue Oct 8, 2019 · 5 comments
Milestone

Comments

@7studio
Copy link

7studio commented Oct 8, 2019

What problem does this feature solve?

For the moment, the rollup-plugin-vue compiles styles in all cases: src/index.ts#L340-L359.

IMHO we should be able to extract styles without compilation to use it for theming or anything else after. I read the plugin code and tried to correctly understand the StyleCompileOptions interface but I didn't found any solution to this need.

In my case, I try to build a library of components which should be themed by a specific context into many applications. But I need to keep my SCSS as it was defined into each component to override default variables correctly.

What does the proposed API look like?

I think setting css:false and at the same time scss:false into style.preprocessOptions should return no compiled styles.

I hope it will help you improve this project.

Xavier

@muyi0327
Copy link

@7studio I have the same problem

@znck
Copy link
Member

znck commented Nov 21, 2019

Duplicate of #300.

@znck znck closed this as completed Nov 21, 2019
@7studio
Copy link
Author

7studio commented Nov 21, 2019

@znck
I'm sorry but my issue has nothing to do with #300 😧

I don't understand why you closed my issue without explanation. The #300 is just a Sass importer problem not a Vue.js or rollup.js one...

The need in my issue is to extract styles (SCSS in my case) without compilation not resolve node_module path into @import rule or anything else 😒

Please consider reopening this issue.

@znck znck reopened this Nov 22, 2019
@weizhenye
Copy link

@7studio Hi, I have made a plugin may satisfy your issue.

@franklx
Copy link

franklx commented Oct 20, 2020

In my opinion user should be free to use any css preprocessor out there, for example I'm using rollup-plugins-styles that's a very good plugin.
Here I added a processStyleTags to make rollup-plugin-vue ignore styles so the css plugin can process them.
If interested I could add documentation and tests and submit a PR.

@znck znck added this to the Zero Issues milestone Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants