Skip to content
Snippets Groups Projects
Verified Commit b4e7eebe authored by David Beniamine's avatar David Beniamine
Browse files

WIP Build using preinstall and prebuild hooks

Currently : submodules install and build are done before building and
installing the main project.

Touching a file in a submodules triggers main project rebuild. But does
not seem to rebuild the submodule.

Also the built package is buggy : there is an error while creating the
annotation window
parent 00aa6b72
No related branches found
No related tags found
No related merge requests found
build_deps.sh 100644 → 100755
#!/bin/bash
cd mirador-video-annotation
docker run --rm -v $PWD:/opt -it node:12 /bin/sh -c "cd /opt && npm install && npm run build:es"
cd ../annotations-plugin
docker run --rm -v $PWD:/opt -it node:12 /bin/sh -c "cd /opt && npm install && npm run build"
declare -A SUBMODULES=(
['mirador-video-annotation']="build:es"
['annotations-plugin']="build"
)
run_on_modules(){
for mod in "${!SUBMODULES[@]}"; do
echo -e "\t$mod"
cd $mod
if [ "$1" == "install" ]; then
npm install
else
npm run ${SUBMODULES[${mod}]}
fi
cd ..
done
}
if [ "$1" == "install" ]; then
echo "Installing submodules"
run_on_modules install
fi
echo "Compiling submodules"
run_on_modules build
This diff is collapsed.
......@@ -4,14 +4,11 @@
"description": "",
"private": true,
"scripts": {
"postinstall": "submodules-install",
"preinstall": "./build_deps.sh install",
"prebuild": "./build_deps.sh build",
"build": "webpack --config webpack.config.js",
"serve": "npm install && webpack serve --config webpack.config.js"
},
"submodules": [
"mirador-video-annotation/*",
"annotations-plugin/*"
],
"author": "",
"license": "ISC",
"dependencies": {
......@@ -21,8 +18,7 @@
"mirador-annotations": "file:annotations-plugin",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"style-loader": "^1.2.1",
"submodules-install": "1.0.2"
"style-loader": "^1.2.1"
},
"devDependencies": {
"webpack": "^4.43.0",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment