Fix watch-task for webpack
This commit is contained in:
@@ -50,10 +50,10 @@ Node.js is required to test this app.
|
||||
2. Run `npm install`.
|
||||
3. Run `npm start`.
|
||||
|
||||
When you edit **.jsx** files, please execute `npm run build` before `npm start`.
|
||||
When you edit `src/**` files, please execute `npm run build` before `npm start`.
|
||||
|
||||
### Development
|
||||
#### `npm run serve`
|
||||
#### `npm run watch`
|
||||
Reload the app automatically when you have saved source codes.
|
||||
|
||||
#### `npm test`
|
||||
|
13
gulpfile.js
13
gulpfile.js
@@ -124,15 +124,18 @@ gulp.task('copy:modules', function() {
|
||||
.pipe(gulp.dest('dist/browser/modules/bootstrap'))
|
||||
});
|
||||
|
||||
gulp.task('serve', ['build'], function() {
|
||||
gulp.task('watch', ['build'], function() {
|
||||
var options = ['--livereload'];
|
||||
electron.start(options);
|
||||
gulp.watch(['src/**', '!src/browser/**', '!src/node_modules/**'], function() {
|
||||
|
||||
gulp.watch(['src/main.js', 'src/main/**/*.js', 'src/common/**/*.js'], ['webpack:main']);
|
||||
gulp.watch(['src/browser/**/*.js', 'src/browser/**/*.jsx'], ['webpack:browser', 'copy:webview:js']);
|
||||
gulp.watch(['src/browser/**/*.css', 'src/browser/**/*.html', 'src/resources/**/*.png'], ['copy']);
|
||||
|
||||
gulp.watch(['dist/main.js', 'dist/resources/**'], function() {
|
||||
electron.restart(options);
|
||||
});
|
||||
gulp.watch('src/browser/**/*.jsx', ['build:jsx']);
|
||||
gulp.watch(['src/browser/**', '!src/browser/**/*.jsx'], electron.reload);
|
||||
gulp.watch('gulpfile.js', process.exit);
|
||||
gulp.watch(['dist/browser/*.js'], electron.reload);
|
||||
});
|
||||
|
||||
function makePackage(platform, arch, callback) {
|
||||
|
@@ -10,7 +10,8 @@
|
||||
"postinstall": "npm run build",
|
||||
"build": "gulp build",
|
||||
"start": "electron dist",
|
||||
"serve": "gulp serve",
|
||||
"watch": "gulp watch",
|
||||
"serve": "gulp watch",
|
||||
"test": "gulp build && mocha",
|
||||
"package": "gulp package",
|
||||
"package:windows": "gulp package:windows",
|
||||
|
Reference in New Issue
Block a user