From 4957acd1a87e48e9f9ba7860e747089ce4bcc903 Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Mon, 24 Oct 2022 13:55:36 +0900 Subject: [PATCH] pack: do not rebuild native node modules by default --- README.md | 21 +++++++++++++++++++-- package.json | 3 +-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0e37b24..c0c6b32 100644 --- a/README.md +++ b/README.md @@ -74,11 +74,14 @@ After cloning the project, run the following command in the terminal: # via npm $ npm i -# via yarn +# via yarn (https://yarnpkg.com) $ yarn install -# via pnpm +# via pnpm (https://pnpm.io) $ pnpm i + +# via cnpm (https://github.com/cnpm/cnpm) +$ cnpm i ``` ## Run in development environment @@ -104,6 +107,20 @@ $ npm run build:linux 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? **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. diff --git a/package.json b/package.json index bdb41bd..2d9c56c 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ "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", "format": "prettier .", - "format:fix": "prettier . --write", - "postinstall": "npm run lint:fix && electron-builder install-app-deps" + "format:fix": "prettier . --write" }, "engines": { "node": ">=16.0.0"