11import OS from 'node:os' ;
22import path from 'node:path' ;
3- import { createRequire } from 'node:module' ;
43
54import type { ForgeConfig } from '@electron-forge/shared-types' ;
65import { MakerSquirrel } from '@electron-forge/maker-squirrel' ;
@@ -14,7 +13,7 @@ import * as dotenv from 'dotenv';
1413import type IForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin' ;
1514import type ICopyPlugin from 'copy-webpack-plugin' ;
1615
17- dotenv . config ( { path : '.env.local' } ) ;
16+ dotenv . config ( { path : '.env.local' } ) ;
1817
1918const ForkTsCheckerWebpackPlugin : typeof IForkTsCheckerWebpackPlugin = require ( 'fork-ts-checker-webpack-plugin' ) ;
2019const CopyPlugin : typeof ICopyPlugin = require ( 'copy-webpack-plugin' ) ;
@@ -78,25 +77,27 @@ const mainConfig: Configuration = {
7877 entry : './src/main/index.ts' ,
7978 // Put your normal webpack config below here
8079 module : {
81- rules : defaultWebpackRules ( ) ,
80+ rules : defaultWebpackRules ( )
8281 } ,
8382 plugins : [
8483 ...webpackPlugins ,
8584 new CopyPlugin ( {
86- patterns : [ {
87- from : path . resolve ( require . resolve ( '@powersync/node/package.json' ) , `../lib/${ extensionPath } ` ) ,
88- to : path . join ( 'powersync' , extensionPath ) ,
89- } ] ,
85+ patterns : [
86+ {
87+ from : path . resolve ( require . resolve ( '@powersync/node/package.json' ) , `../lib/${ extensionPath } ` ) ,
88+ to : path . join ( 'powersync' , extensionPath )
89+ }
90+ ]
9091 } ) ,
9192 new DefinePluginImpl ( {
9293 POWERSYNC_URL : JSON . stringify ( process . env . POWERSYNC_URL ) ,
93- POWERSYNC_TOKEN : JSON . stringify ( process . env . POWERSYNC_TOKEN ) ,
94- } ) ,
94+ POWERSYNC_TOKEN : JSON . stringify ( process . env . POWERSYNC_TOKEN )
95+ } )
9596 ] ,
9697 resolve : {
9798 extensions : [ '.js' , '.ts' , '.jsx' , '.tsx' , '.css' , '.json' ]
9899 } ,
99- target : " electron-main" ,
100+ target : ' electron-main'
100101} ;
101102
102103const rendererConfig : Configuration = {
@@ -107,7 +108,7 @@ const rendererConfig: Configuration = {
107108 test : / \. c s s $ / ,
108109 use : [ { loader : 'style-loader' } , { loader : 'css-loader' } ]
109110 }
110- ] ,
111+ ]
111112 } ,
112113 plugins : webpackPlugins ,
113114 resolve : {
@@ -119,10 +120,10 @@ const config: ForgeConfig = {
119120 packagerConfig : {
120121 asar : {
121122 unpack : '**/{.**,**}/**/powersync/*'
122- } ,
123+ }
123124 } ,
124125 rebuildConfig : {
125- force : true ,
126+ force : true
126127 } ,
127128 makers : [
128129 new MakerSquirrel ( ) ,
@@ -142,7 +143,7 @@ const config: ForgeConfig = {
142143 html : './src/render/index.html' ,
143144 js : './src/render/main.ts' ,
144145 preload : {
145- js : './src/render/preload.ts' ,
146+ js : './src/render/preload.ts'
146147 }
147148 }
148149 ]
0 commit comments