Quill: Decreasing file size, custom lightweight builds

Created on 14 Sep 2016  路  4Comments  路  Source: quilljs/quill

40kb gzip is too much for simple text editor. Can it be decreased or can I make a custom minified build with npm/es6/rollupjs without any themes, plugins and additional functions?

Let say, I just need simple text editor (bold, italic, h2, h3, list, link). I am sure this can be done in 5kb gzip.

Most helpful comment

Wait wait wait I am getting almost half a megabyte from quill in my build, not 40kb, does anyone have some insight on why?

All 4 comments

Also interested in having an option for smaller import or build by handpicking the toolbar options.

From a quick look you could build a smaller release by removing imports and registrations that you won't need in https://github.com/quilljs/quill/blob/develop/quill.js and then run webpack --minimize --config _develop/webpack.config.js to generate a new release.

There is not formalization around this yet but if you look at the entry points for building quill.js and quill.core.js which are respectively quill.js and core.js, all they do is import and register. This is by design and intended to allow custom builds that choose to import and register a custom set of modules, formats, themes, etc. So that is a quick story around customization.

The most minimal build of Quill is quill.core.js (you'll notice the entry point for quill.js imports core.js). You can further minify this if you'd like and gzipped it turns out to be 35.3kB. Building without any es6 -> es5 transpiling yields 23% reduction but uglifier does not currently support minifying ES6 and I'm not aware of a minifier that does this well.

Given that the numbers we're talking about here is far smaller than a screenshot of an editor, Quill's build output is quite reasonable considering all the gains one gets from consistency and predictability from the editor. High value is placed on this, which equates to saved developer time and productivity, even if it means more bytes of code in the build. There is a fixed cost to this and additional formats are actually of very low marginal cost in terms of build size, as you can see from the formats/ source code directory.

I do look forward to the savings from ES6 adoption and if you find savings elsewhere feel free to make suggestions and/or create a pull request.

Wait wait wait I am getting almost half a megabyte from quill in my build, not 40kb, does anyone have some insight on why?

Hello same here;

image

Was this page helpful?
0 / 5 - 0 ratings