mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04:00
update travis build to include node tests. Minor refactor to grunt jobs for node
This commit is contained in:
parent
aad1bc898e
commit
a1b116d2f5
3 changed files with 12 additions and 6 deletions
14
Gruntfile.js
14
Gruntfile.js
|
@ -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,
|
||||
}
|
||||
})
|
||||
]
|
||||
] : []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue