Skip to content

Commit

Permalink
[script] use .npmrc
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed May 14, 2018
1 parent edb9f85 commit 4b9cfc2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build_from_source = true
runtime = "electron"
target = "2.0.0"
dist_url = "https://atom.io/download/electron"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Require __Node.js 8+__, __Python 2.7__, __Visual Studio 2015/2017__, __.Net 4.5.
2. Install dependencies. If you are in Chinese mainland, maybe you should run ```npm config set ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/```before your installing.
``` bash
> cd mishiro
> npm run i
> npm install
```
3. Run building command.
``` bash
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
> cd mishiro
> npm config set registry http://registry.npm.taobao.org/
> npm config set ELECTRON_MIRROR https://npm.taobao.org/mirrors/electron/
> npm run i
> npm install
```
3. 打包生产环境代码。
``` bash
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
"description": "mishiro",
"main": "./public/mishiro.main.js",
"scripts": {
"i": "set npm_config_build_from_source=true&&set npm_config_runtime=electron&&set npm_config_target=%npm_package_devDependencies_electron%&&set npm_config_dist_url=https://atom.io/download/electron&&npm install",
"install": "if not exist \"./public/addon/hca.node\" npm run hca",
"install": "if not exist \"./public/addon/hca.node\" node-gyp rebuild",
"start": "electron . --enable-logging",
"dll": "ts-node -P ./script/tsconfig.json ./script/webpack.ts dll",
"dev": "ts-node -P ./script/tsconfig.json ./script/webpack.ts webpack",
"prod": "set NODE_ENV=production&&ts-node -P ./script/tsconfig.json ./script/webpack.ts webpack",
"pkg": "set NODE_ENV=production&&ts-node -P ./script/tsconfig.json ./script/packager.ts",
"count": "ts-node -P ./script/tsconfig.json ./script/source-count.ts",
"dlc": "ts-node -P ./script/tsconfig.json ./script/release-download-count.ts",
"hca": "node-gyp rebuild --target=%npm_package_devDependencies_electron% --dist-url=https://atom.io/download/electron"
"hca": "node-gyp rebuild"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -42,7 +41,7 @@
"@types/uglifyjs-webpack-plugin": "^1.1.0",
"@types/webpack": "^4.1.3",
"css-loader": "^0.28.11",
"electron": "^2.0.0",
"electron": "2.0.0",
"electron-packager": "^12.0.2",
"fs-extra": "^6.0.0",
"mini-css-extract-plugin": "^0.4.0",
Expand Down
2 changes: 1 addition & 1 deletion script/packager.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const packagerOptions: packageManager.Options = {
platform: 'win32',
arch: arch,
icon: path.join(__dirname, '../src/res/icon/mishiro.ico'),
ignore: /node_modules|build|cache|data|release|download|dist|src|script|public\/img\/card|public\/asset\/sound\/live|public\/asset\/sound\/voice|public\/asset\/score|README|tslint\.json|tsconfig\.json|config\.json|package\.json|package-lock\.json|\.git|\.vscode|binding\.gyp/,
ignore: /node_modules|build|cache|data|release|download|dist|src|script|public\/img\/card|public\/asset\/sound\/live|public\/asset\/sound\/voice|public\/asset\/score|README|tslint\.json|tsconfig\.json|config\.json|package\.json|package-lock\.json|\.git|\.vscode|binding\.gyp|\.npmrc/,
appCopyright: 'Copyright (C) 2017 Toyobayashi',
download: {
cache: path.join(os.homedir(), '.electron'),
Expand Down

0 comments on commit 4b9cfc2

Please sign in to comment.