building stencil library not possible - dist folder not generated
See original GitHub issueHi there,
this might not been an issue per se, more a question. I’m not able to build my nx stencil library to create a dist folder.
Here are the steps I took:
- create a fresh nx 11 workspace
npx create-nx-workspace@latest my-workspace
with a new Angular app - installing nxext
npm install -D @nxext/stencil
- generating a stencil library via
nx g @nxext/stencil:lib web-components
- making stencil lib buildable
nx generate @nxext/stencil:make-lib-buildable web-components
- added output target for angular
nx g @nxext/stencil:add-outputtarget web-components
- added
WebComponentsAngularModule
from@my-workspace/web-components-angular
to app.module.ts
If I now run nx build my-app
I receive an error
Error: libs/web-components-angular/src/lib/web-components-angular.module.ts:3:38 - error TS2307: Cannot find module '@my-workspace/web-components/loader' or its corresponding type declarations.
At a closer look there is no dist folder at /libs/web-components
So I called nx run web-components:build
[56:10.7] build, web-components, prod mode, started ...
[56:10.7] transpile started ...
[56:10.8] transpile finished in 104 ms
[56:10.8] generating angular-library started ...
[56:10.9] generate angular-library finished in 6 ms
[56:10.9] build finished in 132 ms
but there is still no dist folder created.
How can I build my stencil library properly?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
The is no `loader` folder inside the `dist` folder. Can NOT use ...
Expected behavior: I would expect the loader folder to be inside the dist folder, so I could use Stencil web components inside an...
Read more >Distributing Web Components Built with Stencil
The dist type is to generate the component(s) as a reusable library that can be ... It's recommended that this directory not be...
Read more >What is the purpose of created folders in dist - Stack Overflow
I am working with web components using stenciljs . Its great library for creating web components that can we re-use anywhere.
Read more >Getting Started with Monorepo with Nx Nrwl - Rupesh Tiwari
This will solve the problem and you will not have many Git ... Notice the app is building and the dist folder is...
Read more >An Introduction into Stencil.js - Gabriel Tanner
The main goal of this article is to give a quick overview of the Stencil framework and how to use it to build...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, I took a look and prepared a PR for that repo with the fix. Basically the make-buildable builder had the bug, that the loader wasn’t added to the tsconfig. With that, nx wasn’t able to find the loader workspace imports for the angular-module.
Maybe some clarification about what’s going ideally on.
The dist of web-components contain after build the web components. That’s where the loader folder should appear as well. The web-components-angular contains glue-code for the web-components and Angular. They’re both needed