docs: How to use asar archive with unpacked files
This commit is contained in:
Родитель
73ce16fc52
Коммит
f5dc8fc80d
|
@ -142,6 +142,22 @@ archives is generated by guessing, because those files do not exist on the
|
||||||
filesystem. So you should not trust the `Stats` object except for getting file
|
filesystem. So you should not trust the `Stats` object except for getting file
|
||||||
size and checking file type.
|
size and checking file type.
|
||||||
|
|
||||||
## Unpacking files in `asar` archive
|
## Adding unpacked files in `asar` archive
|
||||||
|
|
||||||
|
As stated above, some Node APIs will unpack the file to filesystem when
|
||||||
|
calling, apart from the performance issues, it could also lead to false alerts
|
||||||
|
of virus scanners.
|
||||||
|
|
||||||
|
To work around this, you can unpack some files creating archives by using the
|
||||||
|
`--unpack` option, an example of excluding shared libraries of native modules
|
||||||
|
is:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ asar pack app app.asar --unpack *.node
|
||||||
|
```
|
||||||
|
|
||||||
|
After running the command, apart from the `app.asar`, there is also an
|
||||||
|
`app.asar.unpacked` folder generated which contains the unpacked files, you
|
||||||
|
should copy it together with `app.asar` when shipping it to users.
|
||||||
|
|
||||||
[asar]: https://github.com/atom/asar
|
[asar]: https://github.com/atom/asar
|
||||||
|
|
Загрузка…
Ссылка в новой задаче