- npm install
- Pull down https://github.com/driftyco/ionic
git checkout dead-code-removal
- Run
gulp release.prepareReleasePackage
to build custom version of ionic - Open
dist/ionic-angular/components
and remove the unused component directories songc
is happy when in user land i. Purge all components exceptapp
,avatar
,backdrop
,badge
and then theion
base class files and metadata - Copy
dist/ionic-angular
from ionic repo to this project'snode_modules
dir and overwriteionic-angular
. - Run
npm run ionic:build --prod --parseDeepLinks false
to generate a prod build. - Run
source-map-explorer www/build/main.js www/build/main.js.map
and see what's in the bundle
- Run
npm run ionic:build --aot --optimizejs --parseDeepLinks false
. Look in.tmp
directory for answers on why some code was retained
- Why is
badge
in the bundle but notavatar
orbackdrop
?
- Open
.tmp
and find the file you're interested in inspecting - Copy and paste the content into
./uglify-content.js
. Remove any ES2015 stuff like import/export. - Run
node uglify.js
and observe the output that is retained. - Question yourself: Why is this different than what's in the bundle??