From ed75a9131f786822330dd555fd3a4aa81b8e6960 Mon Sep 17 00:00:00 2001 From: NI Date: Wed, 7 Aug 2019 19:25:13 +0800 Subject: [PATCH] Separate generate from build. --- README.md | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 823120f..696ab29 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ To deploy this project onto the cloud, Google App Engine or Heroku for example, you need to first download the source code, build it locally, then try to deploy it. -The `npm run build` will build all static files, then automatically call +The `npm run generate` will generate all static files, then automatically call `go generate ./...` to bind those static files directly into program source code. You need those generated source code to get application to function. Also because of this, directly call `go build .` on the newly downloaded souce code diff --git a/package.json b/package.json index b6de9dd..9ac9abc 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ }, "scripts": { "dev": "NODE_ENV=development webpack --mode=development --config=webpack.config.js --watch", - "build": "NODE_ENV=production webpack --mode=production --config=webpack.config.js && CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/niruix/sshwifty/application.version=$(git describe --always --abbrev=8 --dirty='*' --tag)\"", + "generate": "NODE_ENV=production webpack --mode=production --config=webpack.config.js", + "build": "npm run generate && CGO_ENABLED=0 go build -ldflags \"-s -w -X github.com/niruix/sshwifty/application.version=$(git describe --always --abbrev=8 --dirty='*' --tag)\"", "lint": "eslint --ext .js,.vue ui", "test": "mocha --require @babel/register --recursive --timeout 3s ./ui/**/*_test.js && go test ./..." },