mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-23 06:15:16 +02:00
Add a "compact" script to the buildpack to reduce final image size. Realized that webpack was always required even though it's a devDep; made it so that it doesn't have to be loaded.
This commit is contained in:
19
buildpack/bin/compact
Executable file
19
buildpack/bin/compact
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e # fail fast
|
||||
set -o pipefail # don't ignore exit codes when piping output
|
||||
# set -x # enable debugging
|
||||
|
||||
bp_dir=$(cd $(dirname $0); cd ..; pwd)
|
||||
|
||||
# Load some convenience functions like status()
|
||||
source $bp_dir/bin/common.sh
|
||||
|
||||
for pack in node bower gulp; do
|
||||
if name=$($bp_dir/buildpacks/$pack/bin/detect "$@"); then
|
||||
if test -f $bp_dir/buildpacks/$pack/bin/compact; then
|
||||
status "Compacting ${name}"
|
||||
$bp_dir/buildpacks/$pack/bin/compact "$@"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user