Production build does not include component styles

Aperta
#4,139 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@tanner-reits ci sta già lavorando.

Dal 14/3/2023.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Bug: Validated
Prerequisites
Stencil Version

3.0.0

Current Behavior

I am writing one component with the following configuration.

@Component({
  tag: 'mpsv-feedback',
  styleUrl: 'feedback.css',
  shadow: true,
})

I have a definition in the component style itself.

:host {
  font-family: "Roboto", sans-serif;
  color: var(--gov-color-secondary);
  font-size: 16px !important;
  margin: 0;
  padding: 0;
}
:host * {
  box-sizing: border-box;
}

During development everything is fine and styles are generated in the component.
image

When I build the component, the styles do not appear after the component is generated.
image

They are clogged in the component chunk itself.
image

Expected Behavior

I expect the same behavior as in the dev environment.
The component will generate the styles it is assigned.

System Info
System: node 18.15.0
     Plaform: darwin (21.6.0)
   CPU Model: Apple M1 Pro (8 cpus)
    Compiler: .../node_modules/@stencil/core/compiler/stencil.js
       Build: 20230228172721
     Stencil: 3.1.0 🍕
  TypeScript: 4.9.5
      Rollup: 2.42.3
      Parse5: 7.1.2
      Sizzle: 2.42.3
      Terser: 5.16.4
Steps to Reproduce
  • Install a new project
  • Add custom styles
  • Set shaddow to true
  • Run npm run build
  • Upload esm modules to server and try to call a component
Code Reproduction URL

https://github.com/zvitek/webcomponent-styles

Additional Information
Lingua principale
TypeScript
Stelle
13.2k
Fork
865
Merge medio
2g 16h
PR unite (30g)
29

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stenciljs/core

Tutte le issue di stenciljs/core

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.