mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
build fixed?
This commit is contained in:
+5
-5
@@ -9,9 +9,9 @@ const {
|
||||
const path = require('path');
|
||||
const { electron } = require('process');
|
||||
|
||||
(async () => {
|
||||
const { nodeapp } = await import('./src/app.js');
|
||||
})();
|
||||
var env = process.env.NODE_ENV || 'prod';
|
||||
|
||||
const { nodeapp } = import(path.join(__dirname, env=='prod' ? '../' : '', 'src/app.js'));
|
||||
|
||||
// Load Icons
|
||||
// TODO: Icons appear pixelated
|
||||
@@ -68,8 +68,8 @@ function createWindow() {
|
||||
try {
|
||||
// loaded = path.join(__dirname, '../client/build/index.html');
|
||||
// win.loadURL(`file://${loaded}`);
|
||||
// win.loadURL('http://localhost:4001/editor');
|
||||
win.loadURL(`file://${__dirname}/dist/index.html`);
|
||||
win.loadURL('http://localhost:4001/editor');
|
||||
//win.loadURL(`file://${__dirname}/dist/index.html`);
|
||||
} catch (error) {
|
||||
loaded = error;
|
||||
}
|
||||
|
||||
+10
-2
@@ -29,14 +29,15 @@
|
||||
"eslint-plugin-simple-import-sort": "^7.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"nodestart": "node app.js",
|
||||
"start": "electron .",
|
||||
"nodestart": "NODE_ENV=development node app.js",
|
||||
"start": "NODE_ENV=development electron .",
|
||||
"pack": "electron-builder --dir",
|
||||
"dist": "electron-builder",
|
||||
"startall": "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\""
|
||||
},
|
||||
"build": {
|
||||
"appId": "your.id",
|
||||
"asar": false,
|
||||
"mac": {
|
||||
"category": "your.app.category.type"
|
||||
},
|
||||
@@ -50,6 +51,13 @@
|
||||
"filter": [
|
||||
"**/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from": "src",
|
||||
"to": "resources/src",
|
||||
"filter": [
|
||||
"**/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+5
-3
@@ -10,7 +10,9 @@ import { fileURLToPath } from 'url';
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const file = join('data/', config.database.filename);
|
||||
var env = process.env.NODE_ENV || 'prod';
|
||||
|
||||
const file = join(__dirname, 'data/', config.database.filename);
|
||||
const adapter = new JSONFile(file);
|
||||
export const db = new Low(adapter);
|
||||
|
||||
@@ -66,10 +68,10 @@ app.use('/event', eventRouter);
|
||||
app.use('/ontime', ontimeRouter);
|
||||
|
||||
// serve react
|
||||
app.use(express.static(path.join(__dirname, '../../client/build')));
|
||||
app.use(express.static(path.join(__dirname, env == 'prod' ? '../' : '../../', 'client/build')));
|
||||
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.resolve(__dirname, '../../client', 'build', 'index.html'));
|
||||
res.sendFile(path.resolve(__dirname, env == 'prod' ? '../' : '../../', 'client', 'build', 'index.html'));
|
||||
});
|
||||
|
||||
// Implement route for errors
|
||||
|
||||
Reference in New Issue
Block a user