-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(build): Generate umd and system files #740
Conversation
…rksoulsong/zustand into generate-umd-and-system-files
Generate umd and system files
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit dc5d981:
|
Ah, I wasn't familiar with it. Looks nice. We try to keep the config consistent among zustand/jotai/vaito as much as possible. Would you be able to create PRs there too? (Once, the questions above are clear.) |
Thanks! About UMD and SystemJS: And I can do the same at jotai/vaito! |
@dai-shi |
Thanks for the explanation!
|
rollup.config.js
Outdated
external, | ||
plugins: [ | ||
resolve({ extensions }), | ||
babelPlugin(getBabelOptions({ ie: 11 })), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do systemjs users need old browser support? (they can use umd in such cases?)
otherwise,
babelPlugin(getBabelOptions({ ie: 11 })), | |
getEsbuild('node12'), |
would build more efficient output?
1 - It's not a bad ideia. I prefer to keep the same config for while. 2 - SystemJs can read AMD, UMD and others formats, so It's not necessary to provide it, but in my opnion it's a good option, you dont need to register a different format in SystemJS (Use just system in system instead of UMD-AMD-ESM in system). Is it a problem? |
@romulo94 Thanks for the follow up. Please update jotai/valtio likewise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for your contribution!
@dai-shi , One last question |
I suppose so. Let's try. |
Released: https://github.com/pmndrs/zustand/releases/tag/v3.6.9 It may take time to be up on CDN? Let me know if you have any issues. |
@dai-shi no issues! Zustand gonna be used with single-spa, it's perfect. |
Hi @dai-shi ,
We were looking for cdn files and the lib didn't have a system or umd file.
We're going to use the lib in microfrontends using single-spa and we need to import like:
<script type="systemjs-importmap"> { "imports": { "single-spa": "https://cdn.jsdelivr.net/npm/[email protected]/lib/system/single-spa.min.js", "react": "https://unpkg.com/browse/[email protected]/umd/react.production.min.js", "react-dom": "https://unpkg.com/browse/[email protected]/umd/react-dom.production.min.js", "zustand": "https://unpkg.com/[email protected]" } } </script>
But we can not use esm or default (./index.js)
Is it possible to add a new config for rollup?