Be better about deps for webpack.

This commit is contained in:
Tony Garnock-Jones 2018-11-21 15:54:05 +00:00
parent 3adb057e13
commit 6359295dd7
1 changed files with 24 additions and 0 deletions

View File

@ -4,6 +4,30 @@ case "$1" in
for d in src/*.js; do [ -f "$d" ] && echo lib/$(basename "$d"); done | xargs redo-ifchange
for d in *.webpack.config.js
do
depifchange=''
depifcreate=''
for dep in $(cat package.json | \
jq -r '.dependencies | to_entries[].key' | \
fgrep '@syndicate-lang/' | \
sed -e 's:^@syndicate-lang/::' | \
fgrep -v 'core') ## core doesn't have any compilation step
do
for srcfile in ../$dep/src/*.js
do
if [ -f $srcfile ]
then
libfile=$(echo $srcfile | sed -e 's:/src/:/lib/:')
if [ -f $libfile ]
then
depifchange="$depifchange $libfile"
else
depifcreate="$depifcreate $libfile"
fi
fi
done
done
redo-ifchange $depifchange
redo-ifchange $depifcreate
[ -f "$d" ] && echo dist/$(basename "$d" .webpack.config.js).js
done | xargs redo-ifchange
[ -f _all.do ] && redo-ifchange _all || true