File tree Expand file tree Collapse file tree 4 files changed +243
-19
lines changed
Expand file tree Collapse file tree 4 files changed +243
-19
lines changed Original file line number Diff line number Diff line change 11import { app , BrowserWindow , ipcMain } from 'electron'
2+ import sqlite3 from 'sqlite3'
3+
4+ const database = new sqlite3 . Database ( './public/db.sqlite3' , ( err ) => {
5+ if ( err ) console . error ( 'Database opening error: ' , err ) ;
6+ } ) ;
27
38let mainWindow : BrowserWindow | null
49
@@ -17,7 +22,7 @@ function createWindow () {
1722 height : 700 ,
1823 backgroundColor : '#191622' ,
1924 webPreferences : {
20- nodeIntegration : false ,
25+ nodeIntegration : true ,
2126 contextIsolation : true ,
2227 preload : MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY
2328 }
Original file line number Diff line number Diff line change 1010 "make" : " electron-forge make" ,
1111 "release" : " electron-forge publish" ,
1212 "lint" : " eslint . --ext js,ts" ,
13- "test" : " jest"
13+ "test" : " jest" ,
14+ "rebuild-sqlite3" : " electron-rebuild -f -w sqlite3"
1415 },
1516 "keywords" : [],
1617 "license" : " MIT" ,
5253 "babel-loader" : " 8.2.2" ,
5354 "cross-env" : " 7.0.3" ,
5455 "electron" : " 13.1.2" ,
56+ "electron-rebuild" : " ^3.2.9" ,
5557 "eslint" : " 7.29.0" ,
5658 "eslint-config-prettier" : " 8.3.0" ,
5759 "eslint-config-standard" : " 16.0.3" ,
6769 "prettier" : " 2.3.1" ,
6870 "ts-jest" : " 27.0.3" ,
6971 "typescript" : " 4.9.5" ,
70- "wait-on" : " 5.3.0"
72+ "wait-on" : " 5.3.0" ,
73+ "webpack-node-externals" : " ^3.0.0"
74+ },
75+ "resolutions" : {
76+ "sqlite3/node-addon-api" : " 3.1.0"
7177 },
7278 "config" : {
7379 "forge" : {
Original file line number Diff line number Diff line change 1+ const nodeExternals = require ( 'webpack-node-externals' ) ;
2+
13module . exports = {
24 resolve : {
35 extensions : [ '.ts' , '.js' ]
46 } ,
57 entry : './electron/main.ts' ,
68 module : {
79 rules : require ( './rules.webpack' ) ,
8- }
10+ } ,
11+ externals : [ nodeExternals ( ) ] ,
912}
You can’t perform that action at this time.
0 commit comments