From 1d84cfe2e2abd15ac373855c2808e4cb466315de Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Sat, 3 Sep 2022 23:01:53 +0100 Subject: [PATCH] build: run `build:prod` on `yarn prepare` Adds `yarn build:prod` to the `yarn prepare` script. For most package managers (e.g. yarn v1 and NPM), the `prepare` script is called automatically when installing from a local location/git url. It's not called when installing from NPM. This is required because the source code doesn't contain the `dist/mermaid.min.js` file, it has to be built first. Fixes installing mermaid via `git`, e.g.: `yarn add git+https://github.com/mermaid-js/mermaid.git` Fixes: 1549eb20dfbf0698749ab50b2cb264e63d2015b5 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1bf1be7ab..431b5785a 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "test": "yarn lint && jest src/.*", "test:watch": "jest --watch src", "prepublishOnly": "yarn build && yarn test", - "prepare": "husky install", + "prepare": "concurrently \"husky install\" \"yarn build:prod\"", "pre-commit": "lint-staged" }, "repository": { @@ -132,4 +132,4 @@ "**/*.css", "**/*.scss" ] -} \ No newline at end of file +}