filer
filer copied to clipboard
Reduce size of filer.js
parcel build --global Filer src/index.js --out-file filer.min.js --detailed-report
✨ Built in 263ms.
dist/filer.min.js 89.26 KB 155ms
├── src/filesystem/implementation.js 20.39 KB 10ms
├── node_modules/buffer/index.js 19.54 KB 11ms
├── node_modules/minimatch/minimatch.js 7.32 KB 11ms
├── src/shell/shell.js 3.88 KB 4ms
├── lib/intercom.js 3.76 KB 8ms
├── src/filesystem/interface.js 3.39 KB 3ms
├── src/providers/websql.js 2.47 KB 3ms
├── lib/nodash.js 2.35 KB 8ms
├── src/providers/indexeddb.js 2.17 KB 4ms
├── node_modules/path-browserify/index.js 2.1 KB 2ms
└── + 27 more assets
We're currently sitting at ~89K for our minified version. That's a lot. Looking at the bundle info above, a few things we could do here:
- Pull the Shell out into a separate file (3K + 7K = 10K). You don't always need it, so let's not always bundle it
- Reduce the size of
implementation.js
by moving toasync/await
and throwing away most of the callback code. We have tones of code that is just functions wrapped around checks err callbacks. If we usedasync/await
instead, we'd justawait
in atry...catch
. - ~~#569 to pull WebSQL out into a separate file (2K)~~
- ~~#572 to remove nodash.js (2K)~~
~~#597 to switch away from our internal src/path.js
~~
#598 to switch from minimatch to picomatch