mirror of
https://github.com/frappe/books.git
synced 2024-11-10 15:50:56 +00:00
ddd9a786d2
- frappe start command - starts frappejs server - sets up webpack middleware to bundle files - introduce frappe.conf.js for configuration
25 lines
840 B
JavaScript
25 lines
840 B
JavaScript
const { spawn } = require('child_process');
|
|
const { startWebpackDevServer } = require('./serve');
|
|
const { getAppConfig, resolveAppDir } = require('./utils');
|
|
const appConfig = getAppConfig();
|
|
|
|
module.exports = function start(mode) {
|
|
process.env.NODE_ENV = 'development';
|
|
|
|
if (mode === 'electron') {
|
|
const electron = require('electron');
|
|
const electronPaths = appConfig.electron.paths;
|
|
|
|
startWebpackDevServer()
|
|
.then((devServer) => {
|
|
const p = spawn(electron, [resolveAppDir(electronPaths.mainDev)], { stdio: 'inherit' })
|
|
p.on('close', () => {
|
|
devServer.close();
|
|
});
|
|
});
|
|
} else {
|
|
const nodePaths = appConfig.node.paths;
|
|
|
|
spawn('node', [resolveAppDir(nodePaths.main)], { stdio: 'inherit' })
|
|
}
|
|
} |