https://github.com/johnste/lit-component-angular-repro
https://github.com/johnste/lit-component-angular-repro
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnste/lit-component-angular-repro
- Owner: johnste
- Created: 2021-10-03T17:46:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-04T06:53:48.000Z (over 4 years ago)
- Last Synced: 2025-02-15T06:26:07.913Z (over 1 year ago)
- Language: TypeScript
- Size: 144 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Example repro using a lit based web component
in development mode `npm start` everything works fine.
when building `npm run build -- --prod` and serving, the web component code is missing
Solved:
The problem turned out to be [@angular-devkit/build-optimizer](https://www.npmjs.com/package/@angular-devkit/build-optimizer) assuming all decorators are side effect free (which lit's isn't, and, assuming neither is Stencil's). See this discussion https://github.com/angular/angular-cli/issues/20714#issuecomment-841255528
Registering the lit component directly (e.g. `customElements.define('simple-component', SimpleComponent);`) works.