2019-12-22 22:15:31 -07:00
|
|
|
#!/bin/bash
|
2019-09-11 22:28:50 -06:00
|
|
|
# This script removes some stuff in `www/node_modules` that the app doesn't need to run.
|
|
|
|
# It removes about 6MB from the build size.
|
|
|
|
|
2019-09-28 21:23:57 -06:00
|
|
|
echo "Removing bloat in node_modules..."
|
|
|
|
|
2020-08-12 16:06:30 -06:00
|
|
|
set -e
|
2019-10-05 20:16:43 -06:00
|
|
|
|
2020-08-12 16:06:30 -06:00
|
|
|
DIR="$(pwd)/www/node_modules"
|
|
|
|
|
|
|
|
cd $DIR
|
|
|
|
rm -rf {ansicolors,buffer-from,cardinal,chartjs-color,chartjs-color-string,color-convert,color-name}
|
|
|
|
rm -rf {concat-stream,core-util-is,csscolorparser,dom7,earcut,esprima,geojson-vt}
|
2022-09-01 01:33:06 -06:00
|
|
|
rm -rf {gl-matrix,grid-index,ieee754,inherits,isarray,kdbush,leaflet-geometryutil,@mapbox,mapbox-gl}
|
|
|
|
rm -rf {minimist,moment,murmurhash-js,path-to-regexp,pbf,potpack,process-nextick-args}
|
2019-12-22 21:56:28 -07:00
|
|
|
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 {template7,text-encoding,through,tinyqueue,ts-custom-error,typedarray}
|
|
|
|
rm -rf {util-deprecate,vt-pbf,wgs84}
|
|
|
|
|
2019-12-29 16:39:11 -07:00
|
|
|
# Make npm stop complaining that these don't exist by actually removing them
|
|
|
|
rm -rf .bin/*
|
|
|
|
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
|
|
|
|
2020-03-19 00:23:08 -06:00
|
|
|
cd bwip-js
|
|
|
|
rm -rf {bin,examples,src,barcode.ps,demo.html,stb_truetype.h}
|
|
|
|
rm -rf dist/bwip-js.js
|
|
|
|
rm -rf dist/node-bwipjs.js
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-09-11 22:28:50 -06:00
|
|
|
|
2020-08-12 16:06:30 -06:00
|
|
|
cd chart.js/dist
|
2020-08-12 16:42:44 -06:00
|
|
|
rm -rf {Chart.bundle.js,Chart.css,Chart.min.js,Chart.js}
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2020-08-11 22:40:28 -06:00
|
|
|
|
2019-09-11 22:28:50 -06:00
|
|
|
cd @fortawesome/fontawesome-free
|
2019-12-29 16:39:11 -07:00
|
|
|
rm -rf {js,less,metadata,scss,sprites,svgs}
|
|
|
|
find css -type f -not -name 'all.min.css' -delete
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-09-11 22:28:50 -06:00
|
|
|
|
2019-12-29 16:39:11 -07:00
|
|
|
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
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-12-29 16:39:11 -07:00
|
|
|
|
2019-09-11 22:28:50 -06:00
|
|
|
cd jquery
|
|
|
|
rm -rf src
|
|
|
|
rm -rf external
|
2019-12-29 16:39:11 -07:00
|
|
|
find dist -type f -not -name 'jquery.min.js' -delete
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-09-11 22:28:50 -06:00
|
|
|
|
2019-11-14 20:06:44 -07:00
|
|
|
cd jsbarcode
|
2019-11-14 21:23:50 -07:00
|
|
|
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
|
2019-12-29 16:39:11 -07:00
|
|
|
rm -rf {automation,bin}
|
2019-11-14 20:06:44 -07:00
|
|
|
rm -rf dist/barcodes
|
|
|
|
rm -rf dist/JsBarcode.all.js
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-11-14 20:06:44 -07:00
|
|
|
|
2019-12-29 16:39:11 -07:00
|
|
|
cd leaflet
|
|
|
|
rm -rf {CHANGELOG.md,src}
|
|
|
|
find dist -type f -not -name 'leaflet.css' -not -name 'leaflet.js' -delete
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-12-29 16:39:11 -07:00
|
|
|
|
|
|
|
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
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-12-29 16:39:11 -07:00
|
|
|
|
|
|
|
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
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-11-26 21:45:46 -07:00
|
|
|
|
2019-09-28 21:23:57 -06:00
|
|
|
cd material-design-icons
|
2019-12-29 16:39:11 -07:00
|
|
|
# Remove everything except the icon font and license, but also exclude the
|
|
|
|
# current and parent folder (. , ..) so rm won't complain about refusing
|
|
|
|
# to delete the whole filesystem
|
|
|
|
find . -maxdepth 1 -not -name '.' -not -name 'LICENSE' -not -name 'iconfont' -exec rm -rf {} \;
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-09-28 21:23:57 -06:00
|
|
|
|
2022-08-31 14:37:43 -06:00
|
|
|
cd maplibre-gl
|
2019-12-22 21:56:28 -07:00
|
|
|
rm -rf {build,flow-typed,src}
|
2022-08-31 14:37:43 -06:00
|
|
|
find dist -type f -not -name 'maplibre-gl.css' -not -name 'maplibre-gl.js' -delete
|
2019-12-29 16:39:11 -07:00
|
|
|
rm -rf dist/style-spec
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-12-22 21:56:28 -07:00
|
|
|
|
2020-08-12 17:42:20 -06:00
|
|
|
cd onscan.js
|
|
|
|
find . -type f -not -name 'onscan.min.js' -delete
|
|
|
|
rm -rf {.github,.settings}
|
|
|
|
cd $DIR
|
|
|
|
|
2019-12-29 16:39:11 -07:00
|
|
|
cd @zxing/library
|
|
|
|
rm -rf {esm,esm5}
|
|
|
|
rm -f umd/index.min.js.map
|
2020-08-12 16:06:30 -06:00
|
|
|
cd $DIR
|
2019-12-22 21:56:28 -07:00
|
|
|
|
2019-10-05 20:10:09 -06:00
|
|
|
echo "Cleanup finished"
|