From 920c6024ec1a2ed703f557e2d71ccc406026053b Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Tue, 3 Oct 2017 09:39:16 +0100 Subject: [PATCH] Update scripts and config file names Before: `npm run build:compile` -> compiles to `lib` `npm run build:browser` -> uses `browser` config -> builds to `dist` `npm run build:demo` -> uses `production` config -> builds to `demo` After: `npm run build:lib` -> builds to `lib` `npm run build:dist` -> uses `dist` config -> builds to `dist` `npm run build:demo` -> uses `demo` config -> builds to `demo` Also, build dist in travis for extra error checking --- .travis.yml | 3 ++- package.json | 10 +++++----- webpack.production.babel.js => webpack.demo.babel.js | 0 webpack.browser.babel.js => webpack.dist.babel.js | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) rename webpack.production.babel.js => webpack.demo.babel.js (100%) rename webpack.browser.babel.js => webpack.dist.babel.js (86%) diff --git a/.travis.yml b/.travis.yml index 3ee5b0ec..b1f7ca64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,9 @@ node_js: script: - npm run lint - npm run test - - npm run build:compile + - npm run build:lib - npm run build:demo + - npm run build:dist after_success: - npm run coverage - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && sshpass -e scp -r -o stricthostkeychecking=no demo/* $DEPLOY_DEST diff --git a/package.json b/package.json index ba727220..0816fcc5 100644 --- a/package.json +++ b/package.json @@ -6,17 +6,17 @@ "typings": "index.d.ts", "scripts": { "clean": "rimraf lib demo", - "build:demo": "cross-env NODE_ENV=production webpack --config webpack.production.babel.js", - "build:browser": "cross-env NODE_ENV=production webpack --config webpack.browser.babel.js", - "build:compile": "cross-env NODE_ENV=production babel src -d lib --ignore src/demo", "start": "webpack-dev-server", "lint": "standard --verbose | snazzy", "test": "cross-env NODE_ENV=test babel-node ./node_modules/karma/bin/karma start test/karma.config.js", "coverage": "codecov", + "build:lib": "cross-env NODE_ENV=production babel src -d lib --ignore src/demo", + "build:demo": "cross-env NODE_ENV=production webpack --config webpack.demo.babel.js", + "build:dist": "cross-env NODE_ENV=production webpack --config webpack.dist.babel.js", "preversion": "npm run lint", - "version": "npm run update-changelog && npm run build:browser && git add CHANGELOG.md dist", + "version": "npm run update-changelog && npm run build:dist && git add CHANGELOG.md dist", "update-changelog": "auto-changelog --package --template compact", - "prepublishOnly": "npm run build:compile && npm run build:browser", + "prepublishOnly": "npm run build:lib && npm run build:dist", "postpublish": "npm run clean" }, "repository": { diff --git a/webpack.production.babel.js b/webpack.demo.babel.js similarity index 100% rename from webpack.production.babel.js rename to webpack.demo.babel.js diff --git a/webpack.browser.babel.js b/webpack.dist.babel.js similarity index 86% rename from webpack.browser.babel.js rename to webpack.dist.babel.js index fe9f7075..b8766434 100644 --- a/webpack.browser.babel.js +++ b/webpack.dist.babel.js @@ -1,5 +1,5 @@ import path from 'path' -import config, { minifyPlugins } from './webpack.production.babel' +import config, { minifyPlugins } from './webpack.demo.babel' export default { ...config,