代码拉取完成,页面将自动刷新
同步操作将从 robergroup/pdman 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
process.env.NODE_ENV = 'development';
var path = require('path');
var childProcess = require('child_process');
var webpack = require('webpack');
var config = require('../config/webpack.dev.config.js');
var WebpackDevServer = require('webpack-dev-server');
var formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
config.entry.index.unshift(`webpack-dev-server/client?http://localhost:3005/`);
var compiler = webpack(config);
compiler.plugin('invalid', function() {
console.log('Compiling...');
});
compiler.plugin('done', function(stats) {
var messages = formatWebpackMessages(stats.toJson({}, true));
if (!messages.errors.length && !messages.warnings.length) {
console.log('Compiled successfully!');
}
if (messages.errors.length) {
console.log('Failed to compile.');
return;
}
if (messages.warnings.length) {
console.log('Compiled with warnings.');
console.log('You may use special comments to disable some warnings.');
}
});
var devServer = new WebpackDevServer(compiler, {
contentBase: path.resolve(__dirname, '../public'),
});
devServer.listen(3005, 'localhost', () => {
// 启动electron
childProcess.spawn('npm', ['run', 'electron'], { shell: true, env: process.env, stdio: 'inherit' })
.on('close', code => process.exit(code))
.on('error', spawnError => console.error(spawnError));
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。