update travis build to include node tests. Minor refactor to grunt jobs for node

This commit is contained in:
d98762625 2019-03-20 15:10:16 +00:00
parent aad1bc898e
commit a1b116d2f5
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,8 @@
language: node_js
node_js:
- node
env:
- NODE_ENV=production
cache: npm
addons:
chrome: stable
@ -11,6 +13,7 @@ before_script:
script:
- grunt lint
- grunt test
- grunt test-node
- grunt docs
- grunt node
- grunt prod --msg="$COMPILE_MSG"

View File

@ -17,6 +17,8 @@ const UglifyJSWebpackPlugin = require("uglifyjs-webpack-plugin");
* @license Apache-2.0
*/
const NODE_PROD = process.env.NODE_ENV === "production";
module.exports = function (grunt) {
grunt.file.defaultEncoding = "utf8";
grunt.file.preserveBOM = false;
@ -271,7 +273,7 @@ module.exports = function (grunt) {
]
},
node: {
mode: process.env.NODE_ENV === "prodction" ? "production" : "development",
mode: NODE_PROD ? "production" : "development",
target: "node",
entry: "./src/node/index.mjs",
externals: [NodeExternals({
@ -290,7 +292,7 @@ module.exports = function (grunt) {
})
],
optimization: {
minimizer: [
minimizer: NODE_PROD ? [
new UglifyJSWebpackPlugin({
cache: true,
parallel: true,
@ -298,11 +300,11 @@ module.exports = function (grunt) {
"keep_fnames": true,
}
})
]
] : []
}
},
nodeRepl: {
mode: process.env.NODE_ENV === "prodction" ? "production" : "development",
mode: NODE_PROD ? "production" : "development",
target: "node",
entry: "./src/node/repl-index.mjs",
externals: [NodeExternals({
@ -321,7 +323,7 @@ module.exports = function (grunt) {
})
],
optimization: {
minimizer: [
minimizer: NODE_PROD ? [
new UglifyJSWebpackPlugin({
parallel: true,
cache: true,
@ -329,7 +331,7 @@ module.exports = function (grunt) {
"keep_fnames": true,
}
})
]
] : []
}
}
},

View File

@ -146,6 +146,7 @@
"node-prod": "NODE_ENV=production grunt node",
"repl": "grunt node && node build/node/CyberChef-repl.js",
"test": "grunt test",
"test-node": "grunt test-node",
"testui": "grunt testui",
"docs": "grunt docs",
"lint": "grunt lint",