2021-06-07 12:36:48 +08:00
|
|
|
import { createServer } from 'vite';
|
|
|
|
|
import path from 'path';
|
2021-06-08 01:26:18 +08:00
|
|
|
import { startCompilerElectron } from './compilerElectron';
|
2021-06-07 12:36:48 +08:00
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
|
const server = await createServer({
|
|
|
|
|
root: path.resolve(__dirname, '../../'),
|
|
|
|
|
});
|
|
|
|
|
|
2021-06-08 01:26:18 +08:00
|
|
|
const app = await server.listen();
|
|
|
|
|
const port = app.config.server.port;
|
|
|
|
|
startCompilerElectron(port);
|
|
|
|
|
process.env.PORT = `${port}`;
|
2021-06-07 12:36:48 +08:00
|
|
|
})();
|