From 00aa6b72154ec3ac59980de29dc640de75aff9b8 Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Tue, 22 Nov 2022 16:33:56 +0100
Subject: [PATCH] WIP using submodule-install

---
 package-lock.json |  2 --
 package.json      | 11 ++++++++---
 webpack.config.js |  2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 2fa55ab..42262dc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,7 +7,6 @@
     "": {
       "name": "mirador-integration",
       "version": "0.0.0",
-      "hasInstallScript": true,
       "license": "ISC",
       "dependencies": {
         "css-loader": "^3.6.0",
@@ -25,7 +24,6 @@
       }
     },
     "annotations-plugin": {
-      "name": "mirador-annotations",
       "version": "0.4.0",
       "license": "Apache-2.0",
       "dependencies": {
diff --git a/package.json b/package.json
index 5e70676..aad79a8 100644
--- a/package.json
+++ b/package.json
@@ -4,10 +4,14 @@
   "description": "",
   "private": true,
   "scripts": {
-    "preinstall": "cd annotations-plugin && npm install && cd ../mirador-video-annotation && npm install",
-    "build": "cd annotations-plugin && npm run build && cd ../mirador-video-annotation && npm run build:es && cd .. && webpack --config webpack.config.js",
+    "postinstall": "submodules-install",
+    "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": {
@@ -17,7 +21,8 @@
     "mirador-annotations": "file:annotations-plugin",
     "react": "^16.13.1",
     "react-dom": "^16.13.1",
-    "style-loader": "^1.2.1"
+    "style-loader": "^1.2.1",
+    "submodules-install": "1.0.2"
   },
   "devDependencies": {
     "webpack": "^4.43.0",
diff --git a/webpack.config.js b/webpack.config.js
index d9fda3b..22ce08f 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -12,7 +12,7 @@ module.exports = {
     },
     devServer: {
       hot: true,
-      watchFiles: ['src/**/*'],
+      watchFiles: ['src/**/*', '*/src/**/*'],
       client: {
           logging: 'verbose',
           overlay: true,
-- 
GitLab