Added webpack build test to npm test script

This commit is contained in:
Mikael Lepistö 2016-05-29 10:08:39 +03:00
parent 2fd63a7868
commit b5d4f907ba
2 changed files with 12 additions and 2 deletions

View File

@ -58,7 +58,7 @@
"plaintest": "mocha --check-leaks -t 10000 -b -R spec test/index.js && npm run tape",
"prepublish": "npm run build",
"tape": "node test/tape/index.js | tap-spec",
"test": "npm run babel && istanbul --config=test/.istanbul.yml cover node_modules/mocha/bin/_mocha -- --check-leaks -t 5000 -b -R spec test/index.js && npm run tape"
"test": "npm run babel && istanbul --config=test/.istanbul.yml cover node_modules/mocha/bin/_mocha -- --check-leaks -t 5000 -b -R spec test/index.js && npm run tape && (npm run build && echo BUILD TEST OK || echo BUILD TEST FAILED)"
},
"bin": {
"knex": "./lib/bin/cli.js"

View File

@ -1,5 +1,15 @@
var webpack = require('webpack');
var plugins = []
var plugins = [
function() {
this.plugin("done", function(stats) {
if (stats.compilation.errors && stats.compilation.errors.length && process.argv.indexOf('--watch') === -1) {
process.on('beforeExit', function() {
process.exit(1);
});
}
});
}
]
var externals = [{
"bluebird": {