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

CSS from a common file included in multiple components should be deduplicated #331

Open
raihle opened this issue Mar 4, 2020 · 0 comments
Milestone

Comments

@raihle
Copy link

raihle commented Mar 4, 2020

Version

5.1.6

Reproduction link

https://github.com/raihle/vue-rollup-duplicate-css-repro

Steps to reproduce

Run npm ci && npm run build. Build output will be in ./dist/src.

What is expected?

All components refer to the same CSS file, and should continue to do so after the build.

What is actually happening?

Component1 and Component2, which both include the CSS using <style src=...>, have the CSS-to-be-injected "inlined".

Component3 and Component4, which instead import the CSS in their <script> tag, correctly refer to a shared shared-styles.css.js.


I am using [email protected]. Vue and vue-template-compiler @ 2.6.11.

The shared CSS is:

.shared {
  padding: 1rem;
}

It shows up on line 21 of Component1.vue.js and Component2.vue.js.

I am trying to build a treeshakeable component library.

@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

2 participants