Skip to content

Instantly share code, notes, and snippets.

@eyy
Last active April 3, 2021 18:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyy/e203c6dfa798fa2592da to your computer and use it in GitHub Desktop.
Save eyy/e203c6dfa798fa2592da to your computer and use it in GitHub Desktop.
Auto reload everything: stylus, browser-sync, express, nodemon
var app = express()
// browser sync
if (app.get('env') === 'development') {
var bs = require('browser-sync')({
logSnippet: false,
files: ['pub/*.html', 'pub/css/*.css', 'views']
})
app.use(require('connect-browser-sync')(bs))
}
{
"scripts": {
"start": "node ./server/www",
"dev": "nodemon ./server/www",
"stylus": "stylus -w --sourcemap-inline -u nib -u jeet pub/css",
"d": "npm run dev",
"s": "npm run stylus"
},
"devDependencies": {
"browser-sync": "",
"jeet": "",
"nib": "",
"nodemon": "",
"stylus": ""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment