-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Bundle size #504
Comments
You might also want to be aware that roughly 50-66% (depending on compression) of the minimised file is emoji. See this comment for more details, and how to strip them out if you're not going to use that feature. |
Thanks, that is good to know. I am not using that feature. Replacing in the source seems like kind of a hack. Would be nice if there was some more offical way to do it. |
This will be fixed in the next release (that, hopefully, will be v 2.0.0-alpha1) The custom emojis were an interesting idea, but will be removed alltogether since they increase the size of the package by a lot. |
I'd be nice if it was possible to register extra features as extensions, for example GMF, and emojis. They would be packaged but not bundled. The user would simply import the extension and register them. This would also simplify configuration when it comes to GMF |
* fix showdown emoji compression * test: fix functional test
First of all, thanks for this package!
I bundle it with webpack and it is currently the largest package in my bundle. The file
dist/showdown.js
is about 169K. However there is alsodist/showdown.min.js
which is only 97K so this is very nice! The problem is that webpack will include the one pointed to by the main field in package.json which isdist/showdown.js
.For react I get their minified dist so I looked at how they do it. They point their main field to a
index.js
that looks like this:This causes webpack to use the minified version of react for production. Since showdown already have a minified version I think it would be simple to implement the same technique to get the minified version into webpack. So I would suggest to create an
index.js
file like this for showdown and point to it in the package.json main:Not sure if it will do better than webpack running uglify on the unminified version but at least it cannot hurt to have it this way?
The text was updated successfully, but these errors were encountered: