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

reduce lib size #22

Closed
giuseppeg opened this issue Apr 14, 2017 · 5 comments
Closed

reduce lib size #22

giuseppeg opened this issue Apr 14, 2017 · 5 comments

Comments

@giuseppeg
Copy link

It seems that the library is 1.38 MB, is there any chance to shrink it?
I think that the lib is very interesting but I wouldn't be able to use it if it is that big in size.

@aknuds1
Copy link
Owner

aknuds1 commented Apr 14, 2017

A minified browserify bundle of the latest version weighs in at 268k for me, produced like this: browserify -p [ minifyify --no-map ] -o dist/bundle.js index.js.

Maybe you could produce a PR for making it even smaller?

@aknuds1
Copy link
Owner

aknuds1 commented Apr 14, 2017

I was able to reduce the minified size to 152k actually, after being more specific with what we import from htmlparser2 and by eliminating our dependency on the ent library.

@aknuds1 aknuds1 closed this as completed Apr 14, 2017
@giuseppeg
Copy link
Author

awesome thank you! I think that you forgot to build an publish dist.
I will try with rollup when I have a spare 30 mins :)

@aknuds1
Copy link
Owner

aknuds1 commented Apr 14, 2017

I'm actually not sure what's the purpose of the dist/ bundle, to be quite honest. It was there when I took over the project, and I'm thinking people would have better ways of including the lib in their project by now. Do you see any need for it?

@giuseppeg
Copy link
Author

No I don't see any point in keeping the dist folder in the repo.
However I would add the files field in package.json and a build script to bundle the lib before publishing (prepublish) and expose it as an UMD module.
Keeping tests and the source code in the npm package is not necessary.

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

No branches or pull requests

2 participants