-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (30 loc) · 867 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
try {
require('electron-reloader')(module);
} catch (_) {}
const fs = require('fs');
const { app, BrowserWindow } = require('electron');
function createWindow() {
// Create the browser window.
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});
// and load the index.html of the app.
win.loadFile('index.html');
win.webContents.on('did-finish-load', function () {
fs.readFile(__dirname + '/tailwind-ui.min.css', 'utf-8', function (
error,
data
) {
console.log('ok');
if (!error) {
var formatedData = data.replace(/\s{2,10}/g, ' ').trim();
win.webContents.insertCSS(formatedData);
}
});
});
}
app.whenReady().then(createWindow);