Skip to content
Snippets Groups Projects
Unverified Commit 77536e75 authored by David Sehnal's avatar David Sehnal Committed by GitHub
Browse files

Merge pull request #292 from MadCatX/provide-rebuild-cmd

Add packaging command to force a full rebuild
parents 6f12f714 3a6ab552
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,17 @@ If working on just the viewer, ``npm run watch-viewer`` will provide shorter com ...@@ -68,6 +68,17 @@ 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. Debug/production mode in browsers can be turned on/off during runtime by calling ``setMolStarDebugMode(true/false, true/false)`` from the dev console.
### Cleaning and forcing a full rebuild
npm run clean
Wipes the `build` and `lib` directories and `.tsbuildinfo` files.
npm run rebuild
Runs the cleanup script prior to building the project, forcing a full rebuild of the project.
Use these commands to resolve occassional build failures which may arise after some dependency updates. Once done, `npm run build` should work again. Note that full rebuilds take more to complete.
### Build for production: ### Build for production:
NODE_ENV=production npm run build NODE_ENV=production npm run build
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
"test": "npm run lint && jest", "test": "npm run lint && jest",
"jest": "jest", "jest": "jest",
"build": "npm run build-tsc && npm run build-extra && npm run build-webpack", "build": "npm run build-tsc && npm run build-extra && npm run build-webpack",
"clean": "node ./scripts/clean.js",
"rebuild": "npm run clean && npm run build",
"build-viewer": "npm run build-tsc && npm run build-extra && npm run build-webpack-viewer", "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\"", "build-tsc": "concurrently \"tsc --incremental\" \"tsc --build tsconfig.commonjs.json --incremental\"",
"build-extra": "cpx \"src/**/*.{scss,html,ico}\" lib/", "build-extra": "cpx \"src/**/*.{scss,html,ico}\" lib/",
...@@ -36,7 +38,7 @@ ...@@ -36,7 +38,7 @@
"volume-server-test": "node lib/commonjs/servers/volume/server.js --idMap em 'test/${id}.mdb' --defaultPort 1336", "volume-server-test": "node lib/commonjs/servers/volume/server.js --idMap em 'test/${id}.mdb' --defaultPort 1336",
"plugin-state": "node lib/commonjs/servers/plugin-state/index.js --working-folder ./build/state --port 1339", "plugin-state": "node lib/commonjs/servers/plugin-state/index.js --working-folder ./build/state --port 1339",
"preversion": "npm run test", "preversion": "npm run test",
"version": "npm run build", "version": "npm run rebuild",
"postversion": "git push && git push --tags" "postversion": "git push && git push --tags"
}, },
"files": [ "files": [
......
/**
* Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Michal Malý <malym@ibt.cas.cz>
*/
const fs = require('fs');
const path = require('path');
const toClean = [
path.resolve(__dirname, '../build'),
path.resolve(__dirname, '../lib'),
path.resolve(__dirname, '../tsconfig.tsbuildinfo'),
];
toClean.forEach(ph => {
if (fs.existsSync(ph))
fs.rm(ph, { recursive: true }, err => { if (err) console.warn(`Failed to delete ${ph}: ${err}`); });
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment