Open jaredly opened 6 years ago
bsb will have a post-full-build hook for this soon
FWIW, you don't need it, I use this trick:
First create a file called build-docs.js
that executes the docs
script from package.json
:
const exec = require("child_process").exec
const packageJson = require("./package.json")
exec(packageJson.scripts.docs, function(err,stdout,stderr) {
console.log(stdout)
if(err) console.error(stderr)
})
then use nodemon
to run that script when there are changes in the src/
folder, so you can add the following scripts to package.json
.
{ "scripts": {
"docs": "redoc --name BlaBla",
"docs:watch": "nodemon --watch src/ build-docs.js",
} }
You don't actually need this script, I just realised, lol 🤣
nodemon -w src/ --exec npm run docs
does the trick
So when you're editing documentation, you can see the results quickly