DevDependencies are not removed when packaging app
See original GitHub issuePre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
6.0.0-beta.67
Electron version
21.0.1
Operating system
macOS Monterey 12.4
Last known working Electron Forge version
No response
Expected behavior
Expected all devDependencies
in package.json
to be pruned prior to generating the output from electron-forge make
or electron-forge package
Actual behavior
When running electron-forge package
on my app, I noticed that the packaged app size is quite large, and none of the devDependencies
are pruned.
For example, here’s a list of some of my devDependencies:
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
After packaging my app, I can see all of these in the out/my_app/.../node_modules
folder:
Steps to reproduce
- Create an Electron app
- Install some devDependencies (like eslint)
- Run
electron-forge make
Additional information
Forge config:
"config": {
"forge": {
"packagerConfig": {
"icon": "./assets/icon",
"ignore": [
"src",
"assets",
"webpack",
"public",
"tsconfig.json",
".eslintrc.js",
".prettierrc.js",
"postcss.config.js",
"prettier.config.js",
"tailwind.config.js",
"README.md",
"LICENSE.md",
"__previewjs__"
]
},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "my_app"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
}
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Packaging with all dependencies/devDependencies removed ...
I am developing an Electron app using Quasar framework . Due to restrictions, my node_modules are static (not allowed to download anything ...
Read more >ng packagr does not remove devDependencies · Issue #1028
ng-packagr copies devDependencies to the final package.json even though they are not whitelisted. i have angular in peerDependencies and ...
Read more >Workspace npm dependencies - Angular
The Angular Framework, Angular CLI, and components used by Angular applications are packaged as npm packages and distributed using the npm registry.
Read more >The difference between dependencies and devDependencies ...
"devDependencies" are required to develop and build your app, but are not needed to run the final version that customers will use. For...
Read more >Is this a dependency or devDependency? - With Blue Ink
Installing all packages (including devDependencies) in a production server is an easy way to remove many “it works on my machine”-like issues ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@erikian Ahhh excellent callout. After my last comment I actually was wondering if all of these came from react being in my project. I will do more research and testing to see if I can make sure my app works properly while
react-scripts
is in the devDependencies. If not, I guess it’s not a huge deal. Just trying to keep my project as lightweight as possible!Seems like this is resolved. Closing!