From 93f8fcbacc633b414604d30cc0eb267f6e001c45 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 10 Feb 2016 15:35:06 +0000 Subject: [PATCH 1/3] Add 'package' script to build a webapp bundle for straight unzipping on a production server. --- .gitignore | 1 + package.json | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f5a3b1bd..2bc43f86 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ lib key.pem cert.pem vector/components.css +packages/ diff --git a/package.json b/package.json index 42aa567e..1a5aa100 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "build:compile": "babel --source-maps -d lib src", "build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js", "build": "npm run build:css && npm run build:compile && npm run build:bundle", + "package": "npm run build && mkdir packages && bestzip packages/vector-`git describe --dirty || echo unknown`.zip vector", "start:js": "webpack -w src/vector/index.js vector/bundle.js", "start:js:prod": "NODE_ENV=production webpack -w src/vector/index.js vector/bundle.js", "start:skins:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/components.css", @@ -49,6 +50,7 @@ "babel": "^5.8.23", "babel-core": "^5.8.25", "babel-loader": "^5.3.2", + "bestzip": "^1.1.3", "catw": "^1.0.1", "css-raw-loader": "^0.1.1", "http-server": "^0.8.4", From 369e35774216df4e63b5411bafc4c2aca1773ee8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 11 Feb 2016 13:40:26 +0000 Subject: [PATCH 2/3] We expect the mkdir to fail when the dir exists, so use ; not && --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1a5aa100..89e51e03 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build:compile": "babel --source-maps -d lib src", "build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js", "build": "npm run build:css && npm run build:compile && npm run build:bundle", - "package": "npm run build && mkdir packages && bestzip packages/vector-`git describe --dirty || echo unknown`.zip vector", + "package": "npm run build && mkdir packages; bestzip packages/vector-`git describe --dirty || echo unknown`.zip vector", "start:js": "webpack -w src/vector/index.js vector/bundle.js", "start:js:prod": "NODE_ENV=production webpack -w src/vector/index.js vector/bundle.js", "start:skins:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/components.css", From 3c75c43d37356f73c1751052e679777d391eea4b Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 11 Feb 2016 13:59:40 +0000 Subject: [PATCH 3/3] Bail if build step fails --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 89e51e03..ff3789e9 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build:compile": "babel --source-maps -d lib src", "build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js", "build": "npm run build:css && npm run build:compile && npm run build:bundle", - "package": "npm run build && mkdir packages; bestzip packages/vector-`git describe --dirty || echo unknown`.zip vector", + "package": "npm run build && (mkdir packages || true) && bestzip packages/vector-`git describe --dirty || echo unknown`.zip vector", "start:js": "webpack -w src/vector/index.js vector/bundle.js", "start:js:prod": "NODE_ENV=production webpack -w src/vector/index.js vector/bundle.js", "start:skins:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/components.css",