Merge pull request #2905 from NoelDeMartin/MOBILE-3825
MOBILE-3825 DX: Fix ionic:serve hook
This commit is contained in:
commit
ac90d9370a
@ -33,7 +33,7 @@
|
|||||||
"test:coverage": "NODE_ENV=testing gulp && jest --coverage",
|
"test:coverage": "NODE_ENV=testing gulp && jest --coverage",
|
||||||
"lint": "NODE_OPTIONS=--max-old-space-size=4096 ng lint",
|
"lint": "NODE_OPTIONS=--max-old-space-size=4096 ng lint",
|
||||||
"ionic:serve:before": "gulp",
|
"ionic:serve:before": "gulp",
|
||||||
"ionic:serve": "gulp watch & NODE_OPTIONS=--max-old-space-size=4096 ng serve",
|
"ionic:serve": "./scripts/serve.sh",
|
||||||
"ionic:build:before": "gulp"
|
"ionic:build:before": "gulp"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
32
scripts/serve.sh
Executable file
32
scripts/serve.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script is necessary because @ionic/cli is passing one argument to the ionic:serve hook
|
||||||
|
# that is unsupported by angular cli: https://github.com/ionic-team/ionic-cli/issues/4743
|
||||||
|
#
|
||||||
|
# Once the issue is fixed, this script can be replaced adding the following npm script:
|
||||||
|
#
|
||||||
|
# "ionic:serve": "gulp watch & NODE_OPTIONS=--max-old-space-size=4096 ng serve"
|
||||||
|
#
|
||||||
|
|
||||||
|
# Run gulp watch.
|
||||||
|
echo "> gulp watch &"
|
||||||
|
gulp watch &
|
||||||
|
|
||||||
|
# Remove unknown arguments and prepare angular target.
|
||||||
|
args=("$@")
|
||||||
|
angulartarget="serve"
|
||||||
|
total=${#args[@]}
|
||||||
|
for ((i=0; i<total; ++i)); do
|
||||||
|
case ${args[i]} in
|
||||||
|
--project=*)
|
||||||
|
unset args[i];
|
||||||
|
;;
|
||||||
|
--platform=*)
|
||||||
|
angulartarget="ionic-cordova-serve";
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Serve app.
|
||||||
|
echo "> NODE_OPTIONS=--max-old-space-size=4096 ng run app:$angulartarget ${args[@]}"
|
||||||
|
NODE_OPTIONS=--max-old-space-size=4096 ng run "app:$angulartarget" ${args[@]}
|
Loading…
x
Reference in New Issue
Block a user