mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 18:22:40 +00:00
restore livereload
It might work after all. Takes some fiddling.
This commit is contained in:
@@ -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 } = require('vitreum');
|
const { pack, watchFile, livereload } = 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,8 +135,9 @@ fs.emptyDirSync('./build');
|
|||||||
|
|
||||||
})().catch(console.error);
|
})().catch(console.error);
|
||||||
|
|
||||||
//In development, set up a watch server (uses Nodemon)
|
//In development, set up LiveReload (refreshes browser), and Nodemon (restarts server)
|
||||||
if(isDev){
|
if(isDev){
|
||||||
|
livereload('./build'); // Install the Chrome extension LiveReload to automatically refresh the browser
|
||||||
watchFile('./server.js', { // Restart server when change detected to this file or any nested directory from here
|
watchFile('./server.js', { // Restart server 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', './client', './themes'], // Ignore folders that are not running server code / avoids unneeded restarts
|
||||||
ext : 'js json' // Extensions to watch (only .js/.json by default)
|
ext : 'js json' // Extensions to watch (only .js/.json by default)
|
||||||
|
|||||||
Reference in New Issue
Block a user