pack: do not rebuild native node modules by default

This commit is contained in:
leejooy96 committed 2022-10-24 13:55:36 +09:00
1 parent 967821d3a3
commit 4957acd1a8
2 files changed
+20 -4

No files matched your search

+19 -2
View File
@@ -74,11 +74,14 @@ After cloning the project, run the following command in the terminal:
# via npm # via npm
$ npm i $ npm i
# via yarn # via yarn (https://yarnpkg.com)
$ yarn install $ yarn install
# via pnpm # via pnpm (https://pnpm.io)
$ pnpm i $ pnpm i
# via cnpm (https://github.com/cnpm/cnpm)
$ cnpm i
``` ```
## Run in development environment ## Run in development environment
@@ -104,6 +107,20 @@ $ npm run build:linux
The built packages can be found in `dist/release/{version}` location. The built packages can be found in `dist/release/{version}` location.
### Build settings for projects that use Native Node modules
For projects that use the **Native Node Module**, add the following script to your package.json: When installing dependencies, electron-builder will take care of any modules that require rebuilding.
```json
{
"scripts": {
"postinstall": "electron-builder install-app-deps"
}
}
```
For more information, please refer to the following article: https://webpack.electron.build/dependency-management#installing-native-node-modules
### What do I need to do for a multi-platform build? ### What do I need to do for a multi-platform build?
**macOS** is recommended if you want to build multiple platforms simultaneously on one platform. Because it can be configured with just a few very simple settings. **macOS** is recommended if you want to build multiple platforms simultaneously on one platform. Because it can be configured with just a few very simple settings.
+1 -2
View File
@@ -17,8 +17,7 @@
"lint": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter src", "lint": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter src",
"lint:fix": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter --fix src", "lint:fix": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
"format": "prettier .", "format": "prettier .",
"format:fix": "prettier . --write", "format:fix": "prettier . --write"
"postinstall": "npm run lint:fix && electron-builder install-app-deps"
}, },
"engines": { "engines": {
"node": ">=16.0.0" "node": ">=16.0.0"