Skip to content
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

Provide an esm build #8

Open
danimoh opened this issue Jan 13, 2019 · 1 comment
Open

Provide an esm build #8

danimoh opened this issue Jan 13, 2019 · 1 comment
Assignees

Comments

@danimoh
Copy link
Member

danimoh commented Jan 13, 2019

Provide an esm build to enable tree shaking in apps importing components from this component library without the need to import all components at once. See webpack tree shaking documentation for more info.

Work and experimentation on this has already been started here.

Unfortunately, with the current state of the build tools, this goal is not achievable for our project structure (vue single file components written in typescript):

To provide .d.ts type declarations after compilation with rollup, dts-bundle can be used. We could also keep our current approach with vue-cli-plugin-ts-bundler but rebuilding that behavior with dts-bundle should be easy.

The default for css option of rollup-plugin-vue already ensures that css styling is embedded into the components and not output as a big css file. Thus, we can benefit from tree shaking for css also.

@danimoh
Copy link
Member Author

danimoh commented Jan 30, 2020

Just stumbled upon these links whcih might be interesting when we touch this issue again:
https://vuejs.org/v2/cookbook/packaging-sfc-for-npm.html
https://github.com/MikeMitterer/vue-ts-sfc-starter

The vue-ts-sfc-starter kit uses rollup-plugin-typescript2 in conjunction with rollup. We should check whether the author found a way around the issues described above.

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