How to choose how bundles are constructed ? #5770
sebastieno
started this conversation in
Stencil Testing
Replies: 1 comment 1 reply
-
@sebastieno thanks for raising this question. Stencil allows you to consume components in two ways:
I haven't seen Stencil compiling all components into a single file, are you sure this is using the Stencil compiler only? Nonetheless if you need specific bundling capabilities I would recommend to bundle your application with a different compiler as Stencil is really only focused and concerned with bundling Stencil components as described above. It doesn't provide additional bundle configurations. Does this answer your question? Let me know if you have any further comments. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm using Stencil to package some components. The idea, for the customer, is to put the main component in his HTML and then use a Prop to tell which component has to be loaded (the customer does not need to known all components, everything is done by me). Everything looks ok but I have a question regarding how I can package the most efficiently my bundles.
Stencil offer me (automatically) two way to bundle :
I would like to tell Stencil which component should be bundled. For example, if my library contains 4 components, I would like to tell Stencil to package those 4 components + the main component, even if some "intermediate" components are included in many bundles.
I tried using 'dist-custom-elements' and rollup (I used the CLI to do some tests), I mostly succeed what I needed but the debugging experience is just awfull (the npm run start does work with the target bundling mechanism, etc.), and I didn't found example on the internet.
I was thinking to create a project for each component (and do copy task for "intermediate" components) to be able to have a single file per component and then create the main component which will load the others, but I feel this is not the right way.
Do you know how I can achieve my goal ?
Thx for your help !
Beta Was this translation helpful? Give feedback.
All reactions