This repository has been archived on 2023-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
old-monorepo/_Dashboard/tasks/watch.js

32 lines
937 B
JavaScript

const { parallel, series, watch } = require('gulp');
const electron = require('./electron');
const hotreload = require('./hotreload');
const assets = require('./assets');
const scripts = require('./scripts');
function watchMainScripts() {
return watch(['app/main/**/*.js'], series(scripts.developBuild, electron.stop, electron.start));
}
function watchRendererScripts() {
return watch(['app/renderer/**/*.js'], series(scripts.developBuild, hotreload.reload));
}
function watchHtml() {
return watch(
['app/renderer/index.html'],
series(assets.copyHtml, hotreload.inject, hotreload.reload),
);
}
watchMainScripts.displayName = 'watch-main-scripts';
watchRendererScripts.displayName = 'watch-renderer-scripts';
watchHtml.displayName = 'watch-html';
exports.start = series(
assets.copyHtml,
scripts.developBuild,
hotreload.start,
electron.start,
parallel(watchMainScripts, watchRendererScripts, watchHtml),
);