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

Feat/umdbundle - supports umd-bundle with corresponding rollup.config and npm-script #45

Closed
wants to merge 3 commits into from

Conversation

fritx
Copy link
Contributor

@fritx fritx commented Apr 21, 2020

For possible umd usage, we need a umd bundle:

  • supports umd-bundle with corresponding rollup.config and npm-script
  • call build:umd in build cmd

Live demo, check it out --->
https://coldemo.github.io/#/playground/crank-async-generator.jsx
https://coldemo.github.io/#/playground/crank-todomvc.jsx

(I've published a temp npm-pkg named 'crank-umd' to get it work)
(It can be removed at some time if crank gets umd supported itself)

(codesandbox can be broken due to some network issues in some area somehow)
(for example, I personally never had luck to open any of them in the docs)

Similar merged PR: realDuang/genjijs#6

PS: I tried to patch the existing rollup.config but failed with

src/index.ts, src/dom.ts, src/html.ts → umd, cjs, esm...
[!] Error: UMD and IIFE output formats are not supported for code-splitting builds.

so I've added a new file: rollup.config.umd

@fritx fritx changed the title Feat/umdbundle Feat/umdbundle - supports umd-bundle with corresponding rollup.config and npm-script Apr 21, 2020
@fritx
Copy link
Contributor Author

fritx commented Apr 22, 2020

@brainkim
Copy link
Member

Thank you for working on this! I don’t fully understand why coldemo requires UMD and not CJS? We can ship a UMD version, but I would want it just to be rolled up (haha) into the general build script for simplicity’s sake. In other words, rather than creating a separate rollup config for umd, just add it to the current rollup config.

Also, I’m very sorry to hear that CodeSandbox isn’t available in your country! I’ve found that CodeSandbox has been incredibly helpful for bootstrapping demos but we may want to consider a different solution if it’s blocked for the international audience.

@brainkim
Copy link
Member

Closing in favor of #108, which should be released on Monday in an 0.2 release.

1 question: does it matter if we leave umd modules untranspiled?

@brainkim brainkim closed this May 17, 2020
@brainkim
Copy link
Member

brainkim commented May 17, 2020

[!] Error: UMD and IIFE output formats are not supported for code-splitting builds.

By the way, this error happens because rollup can’t do multiple files for umd.

@brainkim
Copy link
Member

brainkim commented Jul 2, 2020

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

Successfully merging this pull request may close these issues.

2 participants