Add before_prepare hook to fetch dependencies
This commit is contained in:
parent
7dbf55e60f
commit
ae74a87889
@ -43,6 +43,7 @@
|
|||||||
<splash src="res/android/drawable-port-xxhdpi/screen.png" density="port-xxhdpi"/>
|
<splash src="res/android/drawable-port-xxhdpi/screen.png" density="port-xxhdpi"/>
|
||||||
<splash src="res/android/drawable-port-xxxhdpi/screen.png" density="port-xxxhdpi"/>
|
<splash src="res/android/drawable-port-xxxhdpi/screen.png" density="port-xxxhdpi"/>
|
||||||
|
|
||||||
|
<hook type="before_prepare" src="scripts/get_dependencies.sh" />
|
||||||
<hook type="after_prepare" src="scripts/clean_node_modules.sh" />
|
<hook type="after_prepare" src="scripts/clean_node_modules.sh" />
|
||||||
|
|
||||||
</platform>
|
</platform>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
cd platforms/android/app/src/main/assets/www/node_modules
|
cd platforms/android/app/src/main/assets/www/node_modules
|
||||||
|
|
||||||
echo "Cleaning up node_modules from www..."
|
echo "Cleaning up unneeded files in node_modules..."
|
||||||
|
|
||||||
echo "Size before: $(du -sh | cut -d ' ' -f 1)"
|
echo "Size before: $(du -sh | cut -d ' ' -f 1)"
|
||||||
|
|
||||||
|
15
scripts/get_dependencies.sh
Executable file
15
scripts/get_dependencies.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Installing node modules into www..."
|
||||||
|
|
||||||
|
cd www
|
||||||
|
|
||||||
|
if type "yarn" > /dev/null; then
|
||||||
|
yarn install
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If Yarn isn't installed, use npm
|
||||||
|
echo "Warning: using npm install instead of the preferred yarn install"
|
||||||
|
echo "Consider installing Yarn"
|
||||||
|
npm install
|
Loading…
x
Reference in New Issue
Block a user