wishthis/semantic/tasks/watch.js

50 lines
1 KiB
JavaScript
Raw Normal View History

2022-01-13 13:00:31 +00:00
/*******************************
* Watch Task
*******************************/
2023-08-17 09:47:40 +00:00
const
gulp = require('gulp'),
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
// node dependencies
console = require('better-console'),
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
// user config
config = require('./config/user'),
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
// task config
install = require('./config/project/install'),
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
css = require('./build/css'),
js = require('./build/javascript'),
assets = require('./build/assets')
2022-01-13 13:00:31 +00:00
;
// export task
module.exports = function () {
2023-08-17 09:47:40 +00:00
if (!install.isSetup()) {
console.error('Cannot watch files. Run "gulp install" to set-up Fomantic');
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
return;
}
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
console.clear();
console.log('Watching source files for changes');
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
/* --------------
Watch CSS
--------------- */
css.watch('default', config);
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
/* --------------
Watch JS
--------------- */
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
js.watch('default', config);
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
/* --------------
Watch Assets
--------------- */
2022-01-13 13:00:31 +00:00
2023-08-17 09:47:40 +00:00
assets.watch('default', config);
2022-01-13 13:00:31 +00:00
};