You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
i add nothing to dependencies in package.json except render dependencies such as follows:
after execute quasar build -m electron, all my files in src folder and render dependencies is compiled and repackaged to dist/electron/UnPackaged/js folder. so, just need to add all files in dist/electron/UnPackaged/js/ to app.asar, no other dependencies needed.
however, all dependencies in node_modules except dev dependencies is added to app.asar, makes app.asar grows to 15MB+.
then i add the following into quasar.conf.js, reduced app.asar to only 1MB+, and everything works.
so no need to add any render dependencies in node_modules to app.asar, since all render dependencies has been tree-shaking and repacked to dist/electron/UnPackaged/js/, just add files in this folder to app.asar is ok.
in the real world, we will add some dependencies to the main process. eg, add electron-updater and use it in electron-main.js.
but if i build electron use the config above, then install and run, it will crash and tell you can not find electron-updater. it seems only copied files in src-electron , no repackage and tree-shaking on them with their dependencies.
finally, i find all atomic dependencies electron-updater needs, and add them to files tag in quasar.conf.js as below, rebuild electron, the app.asar grows to 2MB+, and everything works.
files: [
'**/*',
'!**/node_modules/**/*',
// all electron-updater and its dependencies
'**/node_modules/electron-updater/**/*',
'**/node_modules/builder-util-runtime/**/*',
'**/node_modules/fs-extra/**/*',
'**/node_modules/@types/semver/**/*',
'**/node_modules/js-yaml/**/*',
'**/node_modules/lazy-val/**/*',
'**/node_modules/lodash.escaperegexp/**/*',
'**/node_modules/lodash.isequal/**/*',
'**/node_modules/semver/**/*',
'**/node_modules/debug/**/*',
'**/node_modules/sax/**/*',
'**/node_modules/jsonfile/**/*',
'**/node_modules/universalify/**/*',
'**/node_modules/argparse/**/*',
'**/node_modules/lru-cache/**/*',
'**/node_modules/yallist/**/*',
'**/node_modules/ms/**/*',
'**/node_modules/universalify/**/*',
'**/node_modules/graceful-fs/**/*',
],
then if i need more dependencies for the main process, and i don't want to include all render dependencies duplicate to make xxx.exe too big, how could i do ? find all final atomic dependencies, and add them to files?
i also tried electron-packager, the problem is the same as electron-builder.
Describe the solution you'd like
repackage and tree-shaking main process js files with only their dependencies while run quasar build -m electron
Describe alternatives you've considered
add a quasar add electronMainDependencies xxx command, when execute it, add the dependencies to a electronMainDependencies tag in package.json and deliver its value to quasar.conf.js, so i can include them in files and exclude all other files in node_modules.
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
i add nothing to dependencies in package.json except render dependencies such as follows:
after execute
quasar build -m electron
, all my files in src folder and render dependencies is compiled and repackaged todist/electron/UnPackaged/js
folder. so, just need to add all files indist/electron/UnPackaged/js/
to app.asar, no other dependencies needed.however, all dependencies in node_modules except dev dependencies is added to app.asar, makes app.asar grows to 15MB+.
then i add the following into quasar.conf.js, reduced app.asar to only 1MB+, and everything works.
so no need to add any render dependencies in node_modules to app.asar, since all render dependencies has been tree-shaking and repacked to
dist/electron/UnPackaged/js/
, just add files in this folder to app.asar is ok.in the real world, we will add some dependencies to the main process. eg, add electron-updater and use it in electron-main.js.
but if i build electron use the config above, then install and run, it will crash and tell you can not find electron-updater. it seems only copied files in
src-electron
, no repackage and tree-shaking on them with their dependencies.finally, i find all atomic dependencies electron-updater needs, and add them to files tag in quasar.conf.js as below, rebuild electron, the app.asar grows to 2MB+, and everything works.
then if i need more dependencies for the main process, and i don't want to include all render dependencies duplicate to make xxx.exe too big, how could i do ? find all final atomic dependencies, and add them to files?
i also tried electron-packager, the problem is the same as electron-builder.
Describe the solution you'd like
repackage and tree-shaking main process js files with only their dependencies while run
quasar build -m electron
Describe alternatives you've considered
add a
quasar add electronMainDependencies xxx
command, when execute it, add the dependencies to a electronMainDependencies tag in package.json and deliver its value to quasar.conf.js, so i can include them in files and exclude all other files in node_modules.Additional context
The text was updated successfully, but these errors were encountered: