codesbiome / electron-react-webpack-typescript-2024

Electron React Webpack Typescript Boilerplate with Custom Window and Titlebar Menus.
MIT License
347 stars 78 forks source link

looking app.asar content after make #22

Closed panpansh closed 2 years ago

panpansh commented 2 years ago
npx asar extract app.asar ./content

I can see :

app.asar
content/ (app.asar extracted)
├─ .webpack/
│  ├─ main/
│  │  ├─ ....
│  ├─ renderer/
│  │  ├─ ....
├─ node_modules/ (empty)
├─ package.json

can we change the .webpack folder name ? do you know if package.json is really used and can be removed ? can we remove the empty node_modules folder ?

Regards <3

panpansh commented 2 years ago

ok all of that can be done by editing two files

node_modules\@electron-forge\plugin-webpack\dist\WebpackConfig.js
node_modules\@electron-forge\plugin-webpack\dist\WebpackPlugin.js

by example we can remove the node_modules empty folder by commenting line 184 of WebpackPlugin.js

//await _fsExtra.default.mkdirp(_path.default.resolve(buildPath, 'node_modules'));

then I add this in packageAfterCopy

pj.scripts = {};
codesbiome commented 2 years ago

app.asar creation can be disabled by using asar: false in the configuration tools/forge/forge.config.js file

  // Packager Config
  packagerConfig: {
    // Create asar archive for main, renderer process files
    asar: false, 
    // Set executable name
    executableName: 'ERWT Boilerplate',
    // Set application copyright
    appCopyright: 'Copyright (C) 2021 Codesbiome, Guasam',
  },


do you know if package.json is really used and can be removed ?

Removing package.json might cause execution related isssues for the packaged output ERWT Boilerplate.exe.

panpansh commented 2 years ago

thank you for all this constructive discussion