Skip to content

Commit

Permalink
fix: add build process to package, make compatible with npx
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Apr 12, 2020
1 parent 53344f1 commit 4ac239c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/cli.js → bin/cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path')
const { createJSBundle } = require('../scripts/build-bundle-global')

if (args.global && args.outfile) {
let outputFilepath = path.join(process.cwd(), args.outfile)
const outputFilepath = path.join(process.cwd(), args.outfile)

createJSBundle({
outputFilepath
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
"version": "0.0.0-development",
"description": "Inject JS to the DOM to find vulnerable JavaScript libraries",
"bin": {
"js-vulns-detector": "./bin/cli.js"
"js-vulns-detector": "./bin/cli.cjs"
},
"engines": {
"node": ">=10.0.0"
},
"type": "module",
"scripts": {
"build": "node ./bin/cli.js --global --outfile dist/bundle-global.js",
"build": "node ./bin/cli.cjs --global --outfile dist/bundle-global.js",
"lint": "eslint src/* && npm run lint:lockfile",
"lint:lockfile": "lockfile-lint --path package-lock.json --type npm --validate-https --allowed-hosts npm yarn",
"lint:fix": "eslint . --fix",
"format": "prettier --config .prettierrc.js --write '**/*.js'",
"test": "jest",
"prepare": "npm run build",
"test:watch": "jest --watch",
"coverage:view": "open-cli coverage/lcov-report/index.html",
"semantic-release": "semantic-release"
Expand Down

0 comments on commit 4ac239c

Please sign in to comment.