diff --git a/package.json b/package.json index d3e688db0f..c352ef331d 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,9 @@ "build": "webpack --env.platform=web --config ./src/client/config/webpack.prod.config.js --mode production", "lint": "eslint **/*.js" }, + "bin": { + "payload": "./src/bin/index.js" + }, "author": "", "license": "ISC", "dependencies": { diff --git a/src/bin/index.js b/src/bin/index.js new file mode 100755 index 0000000000..5e403b24a7 --- /dev/null +++ b/src/bin/index.js @@ -0,0 +1,24 @@ +#!/usr/bin/env node + +const args = process.argv.slice(2); + +const scriptIndex = args.findIndex( + x => x === 'build' || x === 'test', +); + +const script = scriptIndex === -1 ? args[0] : args[scriptIndex]; + +switch (script) { + case 'build': { + console.log('building'); + break; + } + + case 'test': { + console.log('testing'); + break; + } + default: + console.log(`Unknown script "${script}".`); + break; +}