-
Notifications
You must be signed in to change notification settings - Fork 915
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
Duplicate import problem with sass #110
Comments
That's just how it works - in general, you should only put abstract stuff like variables and mixins in shared imports. Also, if you use the extract css setup for production build, the final CSS will be processed with cssnano which will remove all duplicate rules. |
Not sure if it'll works for everyone, we have same problem like this that needs to be solved, the difference is the CSS comes from a plugin library, in this case handsontable. We have two Vue component that uses this library, and we prefer to have all the component needs (HTML, JS, CSS) are wrapped together in the component. The problem is that both component basically needs Our workaround is to import the CSS with separated Below are the example: (Duplicated)
(Not duplicated!)
|
Sorry for disturb. But in this case, if add scoped attribute to style tag, all the imported scss gets scoped as well which leads to massive code duplication for my extracted css. And I found someone has the same trouble as me: |
Hi! Thank you for the amazing vuejs!
I trying to use sass with vue, but I encountered some problems here.
For example, I have a sass file named
common.sass
which almost everyvue
files need it, so I import it on*.vue
:Then
common.sass
will be imported many times, which make the compiled css file very large because it has many duplicate code.Is there a better way to do it? Thanks again!
The text was updated successfully, but these errors were encountered: