简体   繁体   中英

How package node addon into asar archive with electron-packager?

How can I add node addon (which is used in renderer process!) into asar archive with electron-packager? Webpack generate files:

./dist
    bundle.js
    addon.node
    index.html
    main.css

And then after:

electron-packager ./ --out=./builds --asar --platform=win32 --arch=x64

I don't have addon.node in asar archive.

I tried reproducing the issue but my .node file and electron-packager v12.1.1 and saw that my addon.node file was still correctly in the asar archive. How are you checking that the asar archive doesn't contain your addon.node file? I ran asar extract app.asar to find my node.

Maybe try electron-packager with the --no-prune flag. If your package is required through your devDependencies, then it will be pruned by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM