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

expose ESM browser build - fixes #2436 #2437

Merged
merged 5 commits into from Sep 10, 2018
Merged

expose ESM browser build - fixes #2436 #2437

merged 5 commits into from Sep 10, 2018

Conversation

Rich-Harris
Copy link
Contributor

@Rich-Harris Rich-Harris commented Sep 2, 2018

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Resolves #2436

Description

(No test because I'm not sure it applies here)

This adds a JavaScript module version of the browser build, for use in https://rollupjs.org/repl once rollup/rollupjs.org#153 is merged.

It did occur to me that maybe we should be minifying the browser build, since it's not exactly tiny (854kb, 154kb zipped) — thoughts?

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! There were two questions raised, though.

  1. Naming:
    I would actually go with the .mjs extension (and align the extension of the main bundle in the 1.0 PR; I can take care of that). The browser does not care for extensions anyway but other bundlers like Webpack can and will use this for internal optimization.
  2. Minification:
    Definitely for the browser builds to optimize for the unpkg.com scenario. We still have sourcemaps anyway. The node build, on the other hand, might profit more from native readability and editability.

@lukastaegert
Copy link
Member

@Rich-Harris I added minification to the browser build and changed the extension to .mjs, let me know what you think.

@Rich-Harris
Copy link
Contributor Author

Looks good — I made a small tweak (using module: true to get better minification). If we're embracing mjs and we wanted to be consistent we could maybe change dist/rollup.es.js to dist/rollup.mjs but it's probably not worth the possibility of breakage

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lukastaegert lukastaegert merged commit 444dfd7 into master Sep 10, 2018
@lukastaegert lukastaegert deleted the gh-2436 branch September 10, 2018 07:04
@lukastaegert lukastaegert mentioned this pull request Sep 12, 2018
9 tasks
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.

Expose a native ESM browser build
2 participants