Skip to content

Commit

Permalink
chore: add watch script
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed May 15, 2020
1 parent a1bd752 commit a8d9d2e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const gulp = require('gulp');
const clean = require('./scripts/clean');
const lint = require('./scripts/lint');
const build = require('./scripts/build');
const watch = require('./scripts/watch');
const test = require('./scripts/test');
const release = require('./scripts/release');
const changelog = require('./scripts/changelog');
Expand All @@ -44,6 +45,7 @@ module.exports = {
'clean': clean,
'lint': lint,
'build': gulp.series(prebuild, build),
'watch': watch,
'test': gulp.series(pretest, test.test),
'tdd': gulp.series(pretest, test.tdd),
'changelog': changelog,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"lint": "gulp lint",
"clean": "gulp clean",
"build": "gulp build",
"watch": "gulp watch",
"test": "gulp test",
"tdd": "gulp tdd",
"changelog": "gulp changelog",
Expand Down
34 changes: 34 additions & 0 deletions scripts/watch/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2016-2020 Mickael Jeanroy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

const path = require('path');
const gulp = require('gulp');
const build = require('../build');
const config = require('../config');

module.exports = function watch(done) {
gulp.watch(path.join(config.src, '**', '*.js'), build, () => (
done()
));
};

0 comments on commit a8d9d2e

Please sign in to comment.