Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Reduce bundle size by making autotrack build dependencies optional or split into new package #231

Open
ZhangYiJiang opened this issue Jul 15, 2018 · 1 comment

Comments

@ZhangYiJiang
Copy link

Currently autotrack includes all of the tools needed to build a custom bundle as direct dependencies. This makes it easy to build since users just have to run npm install and all of the build dependencies will be automatically installed, but for users who already use their own bundler and just needs the source, the additional dependencies do add quite a bit of size to node_modules -

$ yarn why autotrack 
yarn why v1.7.0
info Disk size without dependencies: "1.08MB"
info Disk size with transitive dependencies: "15.86MB"

16MB is not a huge amount of disk space, but it is a lot relative to the amount of actual code the package is exporting (more than 16x), and completely unused for many people. A simple way to fix this is to make all of the package dependencies optional, then users who don't need it can use --no-optional when installing to reduce their installation size.

A better, but far more involved solution would be to split the build toolchain into its own package and let users who want to do a custom build install that instead.

@hubgit
Copy link

hubgit commented Jul 8, 2019

I noticed that adding autotrack to a project's dependencies in order to import the plugins also adds various large packages such as rollup and google-closure-compiler-js. It would be good not to have these installed by default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants