Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a "watch mode" #6

Open
jaredly opened this issue Apr 5, 2018 · 3 comments
Open

add a "watch mode" #6

jaredly opened this issue Apr 5, 2018 · 3 comments

Comments

@jaredly
Copy link
Owner

jaredly commented Apr 5, 2018

So when you're editing documentation, you can see the results quickly

@chenglou
Copy link
Contributor

chenglou commented Jun 5, 2018

bsb will have a post-full-build hook for this soon

@wires
Copy link

wires commented Aug 22, 2018

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",
} }

@wires
Copy link

wires commented Aug 22, 2018

You don't actually need this script, I just realised, lol 🤣

nodemon -w src/ --exec npm run docs does the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants