File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,7 @@ import type { ForgeConfig } from "@electron-forge/shared-types";
22import path from "path" ;
33import fs from "fs-extra" ;
44
5- function removeNextjsModules ( exceptionList : string [ ] , extractPath : string ) {
6- const nodeModulesPath = path . join ( extractPath , "resources/app/node_modules" ) ;
7-
5+ function removeNextjsModules ( exceptionList : string [ ] , nodeModulesPath : string ) {
86 fs . readdirSync ( nodeModulesPath ) . forEach ( ( module ) => {
97 if ( ! exceptionList . includes ( module ) ) {
108 fs . removeSync ( path . join ( nodeModulesPath , module ) ) ;
@@ -37,8 +35,22 @@ const config: ForgeConfig = {
3735 // All other modules from nextjs are not needed and can be removed.
3836
3937 const electronModules = [ "electron-serve" ] ;
40-
41- removeNextjsModules ( electronModules , extractPath ) ;
38+ if ( platform === "win32" ) {
39+ removeNextjsModules (
40+ electronModules ,
41+ path . join ( extractPath , "resources/app/node_modules" ) ,
42+ ) ;
43+ } else if ( platform === "darwin" ) {
44+ removeNextjsModules (
45+ electronModules ,
46+ "chisel-editor.app/Contents/Resources/app/node_modules" ,
47+ ) ;
48+ } else if ( platform === "linux" ) {
49+ removeNextjsModules (
50+ electronModules ,
51+ path . join ( extractPath , "resources/app/node_modules" ) ,
52+ ) ;
53+ }
4254
4355 done ( ) ;
4456 } ,
You can’t perform that action at this time.
0 commit comments