Added watch gulp script
This commit is contained in:
parent
711145da0c
commit
d45f8df607
12
README.md
12
README.md
|
@ -124,7 +124,17 @@ jsoneditor:
|
|||
```
|
||||
|
||||
This will generate the files `./jsoneditor.js`, `./jsoneditor.css`, and
|
||||
minified versions in the root of the project.
|
||||
minified versions in the dist of the project.
|
||||
|
||||
- To automatically build when a source file has changed:
|
||||
|
||||
```
|
||||
npm run watch
|
||||
```
|
||||
|
||||
This will update `./jsoneditor.js` and `./jsoneditor.css` in the dist folder
|
||||
on every change, but it will **NOT** update the minified versions as that's
|
||||
an expensive operation.
|
||||
|
||||
|
||||
## Custom builds
|
||||
|
|
|
@ -118,5 +118,11 @@ gulp.task('zip', shell.task([
|
|||
'zip ' + pkg + ' ' + 'README.md NOTICE LICENSE HISTORY.md index.html src dist docs examples -r '
|
||||
]));
|
||||
|
||||
// The watch task (to automatically rebuild when the source code changes)
|
||||
// Does only generate jsoneditor.js and jsoneditor.css, not the minified versions
|
||||
gulp.task('watch', ['bundle', 'bundle-css'], function () {
|
||||
gulp.watch(['src/**/*.js'], ['bundle', 'bundle-css']);
|
||||
});
|
||||
|
||||
// The default task (called when you run `gulp`)
|
||||
gulp.task('default', ['bundle', 'bundle-css', 'copy-img', 'minify']);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"bugs": "https://github.com/josdejong/jsoneditor/issues",
|
||||
"scripts": {
|
||||
"build": "gulp",
|
||||
"watch": "watch",
|
||||
"test": "mocha test"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in New Issue