Skip to content

Web Components: Common parts in entry file #6263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
m-mohr opened this issue Feb 5, 2021 · 0 comments
Open

Web Components: Common parts in entry file #6263

m-mohr opened this issue Feb 5, 2021 · 0 comments

Comments

@m-mohr
Copy link

m-mohr commented Feb 5, 2021

What problem does this feature solve?

Using the --target wc-async switch it seems to be impossible to define a way to add common parts of all components into the entry file.

For example, I have a ComponentA.vue and a ComponentB.vue, which both include a utils.js. Generating the web components with vue-cli and --target wc-async ass the utils.js to all component bundles, although it could make the overall size smaller by just adding it once to the main entry file which calls the bundles for ComponentA and B.

Either this is possible and not documented well enough or this would be a good feature to reduce overall bundle sizes.

I've experimented with several webpack options, but to no avail.

What does the proposed API look like?

An option in vue.config.js where you can specify files that should be made "common" (i.e. added to the entry file instead of the component chunks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant