Search code examples
node.jsnpmelectronasar

How to pack app using Asar but exclude Electron


I want to just pack my Electron application to an asar archive, but without the devDependencies declared in package.json. Actually the only thing I don't need to be packaged to the asar archive is "node_modules/electron", so according to the docs (https://github.com/electron/asar#excluding-multiple-resources-from-being-packed) I've tried:

asar pack . app.asar --unpack-dir "{node_modules/electron}"

But without succes... It still packs "node_modules/electron" to the archive. How to do it correctly?


Solution

  • Apparently this worked:

    asar pack . app.asar --unpack-dir "node_modules/electron" && rd "app.asar.unpacked" /s /q