ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.5k stars 783 forks source link

Scoped styles are not working in production builds with the esmodules branch #392

Closed jgw96 closed 6 years ago

jgw96 commented 6 years ago

Stencil version:

 @stencil/core@<version>

I'm submitting a:

Current behavior:

Using scoped: true in a components works fine in dev builds (the scoped styles get applied correctly) but in production builds the scoped styles are not being applied. It also seems like the data- attributes we use to scope styles are not being applied to elements in production builds.

Expected behavior:

Steps to reproduce:

Related code:

// insert any relevant code here

Other information:

adamdbradley commented 6 years ago

Note: ensure components with different encapsulation are not bundled together. This can be done internally and should be apart of the component graph process: https://github.com/ionic-team/stencil/issues/436

ghaiat commented 6 years ago

hello guys, any update on this one ?

adamdbradley commented 6 years ago

I'm not able to replicate this issue with the latest changes. @jgw96 would you be able to double check this one is good? Thanks

edoparearyee commented 6 years ago

@jgw96 @adamdbradley I'm currently having this issue where scoped styles are not being scoped for production builds. I have pushed an example here based on the stencil starter app: https://github.com/edoparearyee/stencil-scoped-styles-example

You'll see that even though the <app-profile> component has no styles. Styles from <app-home> are being applied to the <app-profile> component.