0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-09 18:02:39 +00:00

Fix Nodemon config

This commit is contained in:
Trevor Buckner
2023-07-06 00:29:45 -04:00
parent 84496f51ba
commit ec339f2717

View File

@@ -2,7 +2,7 @@ const fs = require('fs-extra');
const zlib = require('zlib'); const zlib = require('zlib');
const Proj = require('./project.json'); const Proj = require('./project.json');
const { pack, watchFile, livereload } = require('vitreum'); const { pack, watchFile } = require('vitreum');
const isDev = !!process.argv.find((arg)=>arg=='--dev'); const isDev = !!process.argv.find((arg)=>arg=='--dev');
const lessTransform = require('vitreum/transforms/less.js'); const lessTransform = require('vitreum/transforms/less.js');
@@ -135,12 +135,11 @@ fs.emptyDirSync('./build');
})().catch(console.error); })().catch(console.error);
//In development set up a watch server and livereload //In development, set up a watch server (uses Nodemon)
if(isDev){ if(isDev){
livereload('./build'); watchFile('./server.js', { // Restart server when change detected to this file or any nested directory from here
watchFile('./server.js', { // Rebuild when change detected to this file or any nested directory from here ignore : ['./build', './client', './themes'], // Ignore folders that are not running server code / avoids unneeded restarts
ignore : ['./build'], // Ignore ./build or it will rebuild again ext : 'js json' // Extensions to watch (only .js/.json by default)
ext : 'less', // Other extensions to watch (only .js/.json/.jsx by default) //watch : ['./server', './themes'], // Watch additional folders if needed
//watch: ['./client', './server', './themes'], // Watch additional folders if you want
}); });
} }