标签:res window 加载 star server new func reload serve
cnpm install electron-reload --save-dev
cnpm install electron-prebuilt --save-dev
require(‘electron-reload‘)(__dirname,{
electron:require("electron-prebuilt")
});
cnpm install electron-connect --save-dev
cnpm install gulp --save-dev
var gulp = require(‘gulp‘);
var electron = require(‘electron-connect‘).server.create();
gulp.task(‘watch:electron‘, function () {
electron.start();
gulp.watch(["./src/**/*.js"], electron.restart);
gulp.watch([‘./src/windows/**/*.{html,js,css}‘], electron.reload);
});
main.js
中添加var client = require(‘electron-connect‘).client;
client.create(new BrowserWindow());
gulp watch:electron
标签:res window 加载 star server new func reload serve
原文地址:https://www.cnblogs.com/fws407296762/p/9578898.html