From aaec452bc20356338adc5dbd1ac9d5d12dbb6634 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20Mal=C3=BD?= <madcatxster@devoid-pointer.net>
Date: Sun, 28 Nov 2021 13:28:06 +0100
Subject: [PATCH] Add packaging command to force a full rebuild

---
 README.md    | 5 +++++
 package.json | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/README.md b/README.md
index 0ce2d30e7..dc4b9fa43 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,11 @@ If working on just the viewer, ``npm run watch-viewer`` will provide shorter com
 
 Debug/production mode in browsers can be turned on/off during runtime by calling ``setMolStarDebugMode(true/false, true/false)`` from the dev console.
 
+### Force full rebuild
+    npm run rebuild
+
+Force a full rebuild to resolve build errors that may occassionally arise. Once a force rebuild finishes successfully, incremental `npm run build` can be used again for further builds.
+
 ### Build for production:
     NODE_ENV=production npm run build
 
diff --git a/package.json b/package.json
index 6cc722df2..3732b73ae 100644
--- a/package.json
+++ b/package.json
@@ -16,8 +16,10 @@
     "test": "npm run lint && jest",
     "jest": "jest",
     "build": "npm run build-tsc && npm run build-extra && npm run build-webpack",
+    "rebuild": "npm run rebuild-tsc && npm run build-extra && npm run build-webpack",
     "build-viewer": "npm run build-tsc && npm run build-extra && npm run build-webpack-viewer",
     "build-tsc": "concurrently \"tsc --incremental\" \"tsc --build tsconfig.commonjs.json --incremental\"",
+    "rebuild-tsc": "concurrently \"tsc\" \"tsc --build tsconfig.commonjs.json --incremental\"",
     "build-extra": "cpx \"src/**/*.{scss,html,ico}\" lib/",
     "build-webpack": "webpack --mode production --config ./webpack.config.production.js",
     "build-webpack-viewer": "webpack --mode production --config ./webpack.config.viewer.js",
-- 
GitLab