mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
tidy up gruntfile for node
This commit is contained in:
parent
03e3ab5599
commit
aafde8986d
2 changed files with 5 additions and 29 deletions
30
Gruntfile.js
30
Gruntfile.js
|
@ -28,11 +28,7 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
grunt.registerTask("node",
|
grunt.registerTask("node",
|
||||||
"Compiles CyberChef into a single NodeJS module.",
|
"Compiles CyberChef into a single NodeJS module.",
|
||||||
["clean", "exec:generateConfig", "exec:generateNodeIndex", "webpack:node", "chmod:build"]);
|
["clean", "exec:generateConfig", "exec:generateNodeIndex", "webpack:node", "webpack:nodeRepl", "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",
|
grunt.registerTask("test",
|
||||||
"A task which runs all the operation tests in the tests directory.",
|
"A task which runs all the operation tests in the tests directory.",
|
||||||
|
@ -275,27 +271,7 @@ module.exports = function (grunt) {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
mode: "development",
|
mode: process.env.NODE_ENV,
|
||||||
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),
|
|
||||||
new webpack.optimize.LimitChunkCountPlugin({
|
|
||||||
maxChunks: 1
|
|
||||||
})
|
|
||||||
],
|
|
||||||
},
|
|
||||||
nodeProd: {
|
|
||||||
mode: "production",
|
|
||||||
target: "node",
|
target: "node",
|
||||||
entry: "./src/node/index.mjs",
|
entry: "./src/node/index.mjs",
|
||||||
externals: [NodeExternals({
|
externals: [NodeExternals({
|
||||||
|
@ -326,7 +302,7 @@ module.exports = function (grunt) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodeRepl: {
|
nodeRepl: {
|
||||||
mode: "production",
|
mode: process.env.NODE_ENV,
|
||||||
target: "node",
|
target: "node",
|
||||||
entry: "./src/node/repl-index.mjs",
|
entry: "./src/node/repl-index.mjs",
|
||||||
externals: [NodeExternals({
|
externals: [NodeExternals({
|
||||||
|
|
|
@ -140,9 +140,9 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "grunt dev",
|
"start": "grunt dev",
|
||||||
"start-node": "grunt node",
|
|
||||||
"build": "grunt prod",
|
"build": "grunt prod",
|
||||||
"build-node": "grunt node-prod",
|
"node": "NODE_ENV=development grunt node",
|
||||||
|
"node-prod": "NODE_ENV=production grunt node",
|
||||||
"test": "grunt test",
|
"test": "grunt test",
|
||||||
"testui": "grunt testui",
|
"testui": "grunt testui",
|
||||||
"docs": "grunt docs",
|
"docs": "grunt docs",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue