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

Migrating from browserify to rollup #89

Merged
merged 6 commits into from
Nov 5, 2021
Merged

Migrating from browserify to rollup #89

merged 6 commits into from
Nov 5, 2021

Conversation

sibiraj-s
Copy link
Collaborator

@sibiraj-s sibiraj-s commented Oct 19, 2021

Migrates from browserify to rollup.

  • this allows creating multiple builds like esm/umd/cjs builds easier. this will allow us to switch to es modules in future and also provide backward compatible scripts

New Files created.

  • dist/htmlminifier.umd.bundle.js (for browsers)
  • dist/htmlminifier.umd.bundle.min.js (for browsers minified)
  • dist/htmlminifier.esm.bundle.js (for scripts using modules in browsers)
  • dist/htmlminifier.js (for nodejs using import script)

Also supports new exports syntax. we should be able to provide conditional export of file and also later switch to module without breaking changes.

Breaking change:

  • the dist/htmlminifier.js is now ESM, the browser version can be found in umd/esm.bundle.js.
  • browser bundles no longer adds require to the window scope.

Note: the dist files are not published to npm. hence its very hightly unlike to affect end users.

@DanielRuf
Copy link
Contributor

Hi @sibiraj-s,

can you please adjust the PR title and description so it gets easier to understand that this is about "change the build setup to rollup for faster / easier builds"?

That would be great =)

@sibiraj-s sibiraj-s changed the title Rollup Migrating from browserify to rollup Oct 19, 2021
@sibiraj-s
Copy link
Collaborator Author

Hi @sibiraj-s,

can you please adjust the PR title and description so it gets easier to understand that this is about "change the build setup to rollup for faster / easier builds"?

That would be great =)

Sorry. done.

@DanielRuf
Copy link
Contributor

Sorry. done.

No problem, thank you very much =)

@DanielRuf
Copy link
Contributor

cc @XhmikosR

@alexander-akait
Copy link
Collaborator

Note - adding exports is breaking change

package.json Outdated Show resolved Hide resolved
@sibiraj-s
Copy link
Collaborator Author

Can I go ahead and merge this?

@sibiraj-s sibiraj-s merged commit e12214e into v7-dev Nov 5, 2021
@DanielRuf
Copy link
Contributor

Can I go ahead and merge this?

I took a quick look and the changes look good to me. Sure, you can go ahead.

@sibiraj-s sibiraj-s deleted the rollup branch November 5, 2021 12:39
@sibiraj-s
Copy link
Collaborator Author

Thanks. @DanielRuf

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.

None yet

3 participants