Closed dhrn closed 2 years ago
It is possible, just use the --generatePackageJson option. Also, unused libs should get pruned automatically. The app size sound OK, only electron uses around 100MB.
I have tried to unpack the build, it looks like it is taking all the deps from the angular app. Ideally we don't need any angular dependency
We should allow the user to have more control over what they are doing. i.e If we generate the package json
and we also should consider package-lock.json
apps
- ng-app
- electron-app
- package.json
- package-lock.json
Allow the to user to provide the the own package.json, some thing like this, In angular json
{
"package": {
"options": {
"generatePackageJson": false,
"packageJsonPath": "path to package with lock file"
}
}
"make": {
"options": {
"generatePackageJson": false,
"packageJsonPath": "path to package with lock file"
}
}
}```
The path is the dist/apps/[app-name]/
. You can manually edit the package.json file in the build folder before you package your application (if you do not wish to use the automatic generator).
wait, I would like to configure the pipeline for builds, doing it manually is not correct option. I would like to address it from the NX way, It is great if this is handled from the library side.
generatePackageJson generates a slim package.json automatically for the project, moreover, the packaging process prunes any unused packages automatically. If both of them include some library that is not needed in the final package, you will need to write a script that does this on you behalf before you package the application.
It seems like the slim package.json is generated but then ignored. It looks like it just bundles in every dependency that isn't dev dependencies.. This means that I end up with a 446mb make rather than 120mb make that I get with a non-nx project I created. Is there any way to define which packages get put in? (Sorry I know this is closed)
Describe the bug Build size 120 MB with hello world app.
To Reproduce Create Electron with angular hello world app
Expected behavior
As a user, i should be able to control the dependency along with lock file.
Desktop (please complete the following information):
Additional context