From 75a32f528bb29605cc87160fa49ea7b14bd9109e Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Sat, 28 Jul 2018 17:26:47 -0400 Subject: [PATCH] chore: add build-preview task for local build testing (#1539) --- CONTRIBUTING.md | 10 ++++++++++ package.json | 1 + packages/netlify-cms/package.json | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ead96aa1..a2f33148 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,6 +75,16 @@ Runs the `clean` script and builds the CMS packages. yarn build ``` +### `build-preview` + +Runs the `build` and `build-preview` scripts in each package and serves the resulting build locally. + +#### Usage + +```sh +yarn build-preview +``` + ### `test` Runs all the CMS package tests. diff --git a/package.json b/package.json index d428d681..8b662754 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "start": "npm run bootstrap && npm run watch", "watch": "lerna run watch --parallel", "build": "npm run clean && lerna run build", + "build-preview": "npm run build && lerna run build-preview", "clean": "rimraf packages/*/dist", "reset": "npm run clean && lerna clean --yes", "test": "cross-env NODE_ENV=test jest --no-cache", diff --git a/packages/netlify-cms/package.json b/packages/netlify-cms/package.json index 5143d984..8babb46e 100644 --- a/packages/netlify-cms/package.json +++ b/packages/netlify-cms/package.json @@ -8,7 +8,8 @@ "main": "dist/netlify-cms.js", "scripts": { "watch": "webpack-dev-server --hot --open", - "build": "cross-env NODE_ENV=production webpack" + "build": "cross-env NODE_ENV=production webpack", + "build-preview": "cross-env NODE_ENV=production webpack-dev-server --open" }, "keywords": [ "netlify",