1 Star 0 Fork 2.2K

Admin/pdman

forked from robergroup/pdman 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
start.js 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
jiaoshou1234 提交于 2018-08-27 11:10 . feat: init project and open source
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));
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
NodeJS
1
https://gitee.com/zjhykj_admin/pdman.git
git@gitee.com:zjhykj_admin/pdman.git
zjhykj_admin
pdman
pdman
lite

搜索帮助