Skip to content
On this page

dependencies vs devDependencies

WARNING

This documentation is limited to building App using electron-builder.

If a third-party npm-pkg can be built normally by Vite, we recommend placing it in devDependencies, which will reduce the size of the packaged App. In some extreme cases, such as when using C/C++ addons, if we cannot build it correctly, we need to put it in dependencies to ensure that the App can work properly after being built.

中文

此文档仅限于使用 electron-builder 构建应用

如果一个第三方 npm 包可以被 Vite 正常构建,我们推荐将它放到 devDependencies 中,这会减小应用打包后的体积。

在一些极端的场景中,比如使用 C/C++ 扩展时,如果我们没办法正确的构建它,需要将它放到 dependencies 中以确保应用构建后能够正常工作。