From 37596d3eee8d69fb5c6016d890449c312c159af3 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Fri, 1 Sep 2023 12:42:21 +0200 Subject: [PATCH] Instructions and build script tunings --- amd/src/vue/readme-moodle.txt | 4 +++- build.sh | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/amd/src/vue/readme-moodle.txt b/amd/src/vue/readme-moodle.txt index 7e062a4..c589d31 100644 --- a/amd/src/vue/readme-moodle.txt +++ b/amd/src/vue/readme-moodle.txt @@ -8,4 +8,6 @@ Instructions for downloading and integrating vue 4. add the following to top of both files /* eslint-disable */ - /* eslint no-unused-vars: "off" */ \ No newline at end of file + /* eslint no-unused-vars: "off" */ + +5. run "./vuemode.sh dev -f" or "./vuemode.sh prod -f" to force copying the correct vuejs file to the active file \ No newline at end of file diff --git a/build.sh b/build.sh index fcdde38..fe87032 100755 --- a/build.sh +++ b/build.sh @@ -1,14 +1,21 @@ #!/bin/bash SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) WD=`pwd` + # get the current vuejs mode VUEMODE=`$SCRIPTDIR/vuemode.sh query` if [[ $? -eq 1 ]]; then exit 1 fi -# switch vuejs to prod mode -$SCRIPTDIR/vuemode.sh prod +if [[ "$1" == "dev" ]]; then + BUILDMODE='dev'; +else + BUILDMODE='prod'; +fi + +# switch vuejs to build mode +$SCRIPTDIR/vuemode.sh $BUILDMODE # run the grunt script in the scripts working directory # so we can be sure all javascript is properly built from the most recent source @@ -19,7 +26,7 @@ grunt scssplugin # plugin specific scss task to compile styles.css from scss fil # run the build php script php ${SCRIPTDIR}/build.php $@ -if [[ "$VUEMODE" == "dev" ]]; then +if [[ "$VUEMODE" != "$BUILDMODE" ]]; then # switch vuejs vack to original mode $SCRIPTDIR/vuemode.sh $VUEMODE