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

fix: module bundling (#1081) #1089

Closed
wants to merge 1 commit into from

Conversation

javiertury
Copy link
Contributor

Here is a way to bundle the project with bili, which is a tool based on rollup aimed to simplify the bundle process. As you can see in bili.config.js the configuration is minimal. It also needs the plugin rollup-plugin-typescript2 and generates definitions automatically at dist/index.d.ts.

The bundles are:

  • A CommonJS bundle dist/index.js for package.json#main
  • An ES Module bundle dist/index.esm.js for package.json#module
  • An AMD bundle dist/index.amd.js. Bundles meant for CDNs should be put in package.json#browser, however I'm not familiar with the AMD format and I think it requires special tools to work with, so I will leave package.json#browser blank for now.

@javiertury javiertury changed the title fix: module bundling (#1081) fix: module bundling #1081 Oct 26, 2020
@javiertury javiertury changed the title fix: module bundling #1081 fix: module bundling (#1081) Oct 26, 2020
@TheJoeSchr
Copy link

I forked and yarn pack this branch and tested it locally as tarball and can confirm it works and fixes #1081

Would it be possible to merge this so the package works again?

@javiertury
Copy link
Contributor Author

In my opinion this issue is important. It makes the library no longer compatible with bundlers like webpack and rollup.

@Akryum, I don't know if this PR has been assigned to anyone for review.

I am open to hear some feedback. If you prefer rollup to bili, I can modify this PR to use rollup instead.

@Akryum
Copy link
Member

Akryum commented Jul 4, 2021

Thanks for the PR! I'm using esbuild on the branch to build.

@Akryum Akryum closed this Jul 4, 2021
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.

3 participants