-
-
Notifications
You must be signed in to change notification settings - Fork 835
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
Any
Current Behavior
Currently only dist and www output global styles, which works as described in the docs.
However, if someone wants to use dist-custom-elements and global styles, they have to use dist or www along with it.
It would be nice if we could either:
- decouple global styles generation from specific output targets (breaking change, but more preferable)
- make
dist-custom-elementsalso output global styles (non-breaking, but duplicates css files)
The first option makes more sense, since globalStyles is its own property in the stencil config (same for globalScript). If someone specifies it, it is implied they want it generated, so it shouldn't matter what output targets they are using. And u could even control the output path.
But I would also be ok with the 2nd option, if its easier to implement. Only problem with that is if someone is using 2 or all 3 of the output targets (dist, dist-custom-elements, www), the same css is output in multiple locations for no reason.
Expected Behavior
dist-custom-elements should also output global styles.
Alternatively: When globalStyles is specified in stencil config, styles should be output regardless of output target.
System Info
Steps to Reproduce
npx create-stencil@latest(npm init stencil@latest still errors for me)- add
globalStyle: 'src/global/styles.css',tostencil.config.ts. - create
./src/global/styles.cssfile with some css in it. - remove
distandwwwfrom output targets and leave onlydist-custom-elements - run
npm run build
Code Reproduction URL
https://github.com/dogoku/stencil-global-styles
Additional Information
Related to discussion in #6584