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`.
|
2. Run `npm install`.
|
||||||
3. Run `npm start`.
|
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
|
### Development
|
||||||
#### `npm run serve`
|
#### `npm run watch`
|
||||||
Reload the app automatically when you have saved source codes.
|
Reload the app automatically when you have saved source codes.
|
||||||
|
|
||||||
#### `npm test`
|
#### `npm test`
|
||||||
|
13
gulpfile.js
13
gulpfile.js
@@ -124,15 +124,18 @@ gulp.task('copy:modules', function() {
|
|||||||
.pipe(gulp.dest('dist/browser/modules/bootstrap'))
|
.pipe(gulp.dest('dist/browser/modules/bootstrap'))
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('serve', ['build'], function() {
|
gulp.task('watch', ['build'], function() {
|
||||||
var options = ['--livereload'];
|
var options = ['--livereload'];
|
||||||
electron.start(options);
|
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);
|
electron.restart(options);
|
||||||
});
|
});
|
||||||
gulp.watch('src/browser/**/*.jsx', ['build:jsx']);
|
gulp.watch(['dist/browser/*.js'], electron.reload);
|
||||||
gulp.watch(['src/browser/**', '!src/browser/**/*.jsx'], electron.reload);
|
|
||||||
gulp.watch('gulpfile.js', process.exit);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function makePackage(platform, arch, callback) {
|
function makePackage(platform, arch, callback) {
|
||||||
|
@@ -10,7 +10,8 @@
|
|||||||
"postinstall": "npm run build",
|
"postinstall": "npm run build",
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
"start": "electron dist",
|
"start": "electron dist",
|
||||||
"serve": "gulp serve",
|
"watch": "gulp watch",
|
||||||
|
"serve": "gulp watch",
|
||||||
"test": "gulp build && mocha",
|
"test": "gulp build && mocha",
|
||||||
"package": "gulp package",
|
"package": "gulp package",
|
||||||
"package:windows": "gulp package:windows",
|
"package:windows": "gulp package:windows",
|
||||||
|
Reference in New Issue
Block a user