1
0
mirror of synced 2024-11-15 02:37:40 +01:00

add dev builds for node

This commit is contained in:
d98762625 2019-01-23 10:06:55 +00:00
parent 7522e5de33
commit 781ff956e3
2 changed files with 24 additions and 1 deletions

View File

@ -28,7 +28,11 @@ module.exports = function (grunt) {
grunt.registerTask("node",
"Compiles CyberChef into a single NodeJS module.",
["clean", "exec:generateConfig", "exec:generateNodeIndex", "webpack:node", "webpack:nodeRepl", "chmod:build"]);
["clean", "exec:generateConfig", "exec:generateNodeIndex", "webpack:node", "chmod:build"]);
grunt.registerTask("node-prod",
"Compiles CyberChef into a single NodeJS module.",
["clean", "exec:generateConfig", "exec:generateNodeIndex", "webpack:nodeProd", "webpack:nodeRepl", "chmod:build"]);
grunt.registerTask("test",
"A task which runs all the operation tests in the tests directory.",
@ -270,6 +274,23 @@ module.exports = function (grunt) {
]
},
node: {
mode: "development",
target: "node",
entry: "./src/node/index.mjs",
externals: [NodeExternals({
whitelist: ["crypto-api/src/crypto-api"]
})],
output: {
filename: "CyberChef.js",
path: __dirname + "/build/node",
library: "CyberChef",
libraryTarget: "commonjs2"
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS)
],
},
nodeProd: {
mode: "production",
target: "node",
entry: "./src/node/index.mjs",

View File

@ -138,7 +138,9 @@
},
"scripts": {
"start": "grunt dev",
"start-node": "grunt node",
"build": "grunt prod",
"build-node": "grunt node-prod",
"test": "grunt test",
"testui": "grunt testui",
"docs": "grunt docs",