Fix build errors, reduce APK size

master
Skylar Ittner 4 years ago
parent c69b8933ab
commit 78f9c5f31f

@ -32,7 +32,5 @@
<allow-intent href="itms:*" /> <allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" /> <allow-intent href="itms-apps:*" />
</platform> </platform>
<hook src="scripts/www_npm_install.sh" type="before_prepare" /> <hook src="scripts/npm_prepare.sh" type="before_prepare" />
<hook src="scripts/generate_credits.sh" type="before_prepare" />
<hook src="scripts/remove_bloat.sh" type="before_prepare" />
</widget> </widget>

@ -0,0 +1,5 @@
#!/bin/sh
./scripts/www_npm_install.sh
./scripts/generate_credits.sh
./scripts/remove_bloat.sh

@ -7,75 +7,80 @@ echo "Removing bloat in node_modules..."
pwd pwd
cd www/node_modules cd www/node_modules
rm -rf {ansicolors,buffer-from,concat-stream,core-util-is,csscolorparser} rm -rf {ansicolors,buffer-from,cardinal,concat-stream,core-util-is,csscolorparser}
rm -rf {dom7,earcut,geojson-vt,gl-matrix,grid-index,ieee754,inherits,isarray} rm -rf {dom7,earcut,esprima,geojson-vt,gl-matrix,grid-index,ieee754,inherits,isarray}
rm -rf {kdbush,minimist,murmurhash-js,path-to-regexp,potpack,process-nextick-args} rm -rf {kdbush,leaflet-geometryutil,@mapbox,minimist,murmurhash-js}
rm -rf {path-to-regexp,pbf,potpack,process-nextick-args}
rm -rf {protocol-buffers-schema,quickselect,readable-stream,redeyed,resolve-protobuf-schema} rm -rf {protocol-buffers-schema,quickselect,readable-stream,redeyed,resolve-protobuf-schema}
rm -rf {rw,safe-buffer,sharkdown,split,ssr-window,string_decoder,supercluster} rm -rf {rw,safe-buffer,sharkdown,split,ssr-window,string_decoder,supercluster}
rm -rf {template7,text-encoding,through,tinyqueue,ts-custom-error,typedarray} rm -rf {template7,text-encoding,through,tinyqueue,ts-custom-error,typedarray}
rm -rf {util-deprecate,vt-pbf,wgs84} rm -rf {util-deprecate,vt-pbf,wgs84}
# Make npm stop complaining that these don't exist by actually removing them
rm -rf .bin/*
cd @fortawesome/fontawesome-free cd @fortawesome/fontawesome-free
rm -rf js rm -rf {js,less,metadata,scss,sprites,svgs}
rm -rf less find css -type f -not -name 'all.min.css' -delete
rm -rf scss
rm -rf sprites
rm -rf svgs
cd ../.. cd ../..
cd framework7
rm -rf components
rm -rf lazy-components
rm -rf less
rm -rf modules
rm -rf utils
rm -f framework7.*
rm -f framework7-lite.*
find css -type f -not -name 'framework7.bundle.min.css' -delete
find js -type f -not -name 'framework7.bundle.min.js' -delete
cd ..
cd jquery cd jquery
rm -rf src rm -rf src
rm -rf external rm -rf external
find dist -type f -not -name 'jquery.min.js' -delete
cd .. cd ..
cd jsbarcode cd jsbarcode
rm -rf .dockerignore .eslintignore .eslintrcautomation bower.json CONTRIBUTING.md docker-compose.yml Dockerfile example gulpfile.js jsbarcode.d.ts README.md src test .travis.yml rm -rf .dockerignore .eslintignore .eslintrcautomation bower.json CONTRIBUTING.md docker-compose.yml Dockerfile example gulpfile.js jsbarcode.d.ts README.md src test .travis.yml
rm -rf {automation,bin}
rm -rf dist/barcodes rm -rf dist/barcodes
rm -rf dist/JsBarcode.all.js rm -rf dist/JsBarcode.all.js
cd .. cd ..
cd framework7 cd leaflet
rm -rf components rm -rf {CHANGELOG.md,src}
rm -rf lazy-components find dist -type f -not -name 'leaflet.css' -not -name 'leaflet.js' -delete
rm -rf less cd ..
rm -rf modules
rm -rf utils cd leaflet.locatecontrol
rm -rf {CHANGELOG.md,README.md,src}
find dist -type f -not -name 'L.Control.Locate.min.css' -not -name 'L.Control.Locate.min.js' -delete
cd ..
cd leaflet.markercluster
rm -rf {build,example,spec,src,CHANGELOG.md}
find dist -type f -not -name 'leaflet.markercluster.js' -not -name 'MarkerCluster.css' -not -name 'MarkerCluster.Default.css' -delete
cd .. cd ..
cd material-design-icons cd material-design-icons
rm -rf action # Remove everything except the icon font and license, but also exclude the
rm -rf alert # current and parent folder (. , ..) so rm won't complain about refusing
rm -rf av # to delete the whole filesystem
rm -rf bower.json find . -maxdepth 1 -not -name '.' -not -name 'LICENSE' -not -name 'iconfont' -exec rm -rf {} \;
rm -rf communication
rm -rf content
rm -rf device
rm -rf editor
rm -rf file
rm -rf gulpfile.babel.js
rm -rf hardware
rm -rf image
rm -rf index.js
rm -rf maps
rm -rf navigation
rm -rf notification
rm -rf package.json
rm -rf places
rm -rf README.md
rm -rf social
rm -rf sprites
rm -rf toggle
cd .. cd ..
cd mapbox-gl cd mapbox-gl
rm -rf {build,flow-typed,src} rm -rf {build,flow-typed,src}
cd dist find dist -type f -not -name 'mapbox-gl.css' -not -name 'mapbox-gl.js' -delete
rm -rf ./*.map rm -rf dist/style-spec
rm -rf ./*.flow
rm -rf {mapbox-gl-csp.js,mapbox-gl-csp-worker.js,mapbox-gl-dev.js,mapbox-gl-unminified.js}
cd ..
cd .. cd ..
cd @zxing/library
rm -rf {esm,esm5}
rm -f umd/index.min.js.map
cd ../..
echo "Cleanup finished" echo "Cleanup finished"

Loading…
Cancel
Save