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: add browser esm build #123

Merged
merged 9 commits into from
Feb 5, 2021
Merged

feat: add browser esm build #123

merged 9 commits into from
Feb 5, 2021

Conversation

antfu
Copy link
Member

@antfu antfu commented Feb 3, 2021

Follow up #109

  • Inlined join and dirname so it no longer relays on path in browser build.
  • New ESM build for browser under ./dist/index.browser.mjs where you would need to import explicitly with full URL when using in the browser.

/cc @43081j

@antfu
Copy link
Member Author

antfu commented Feb 3, 2021

Tests failed due to the missing of dark-vs.json and light-vs.json, which I supposed is not introduced in this PR. Do you have any clue about how would that happen? (also seems like the tests are not triggered for the commits on the master branch)

@antfu
Copy link
Member Author

antfu commented Feb 3, 2021

Ah, should be this one 840a6cf

@43081j
Copy link
Contributor

43081j commented Feb 4, 2021

looks good, i tried it in chrome and it works well.

just so i understand, what is it that bundles the dependencies into the output file? its right, i just wondered where that happens as the two rollup bundles look identical except the browser one has terser, so is it terser which causes it to be one single-file bundle?

@antfu antfu merged commit daa9b39 into master Feb 5, 2021
@antfu antfu deleted the feat/browser-esm branch February 5, 2021 03:42
@antfu
Copy link
Member Author

antfu commented Feb 5, 2021

@43081j the difference is that the external options which controls whether the deps should be bundled. terser is used for minification.

@43081j
Copy link
Contributor

43081j commented Feb 5, 2021

yeah i thought so, thats why i was confused :D i didn't notice the external part! thanks for pointing that out

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