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: 1549eb20df
This commit is contained in:
Alois Klink 2022-09-03 23:01:53 +01:00 committed by GitHub
parent ec7dd9ef01
commit 1d84cfe2e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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"
]
}
}