Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: run scripts in parallel for build and clean #1747

Merged
merged 2 commits into from Oct 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -46,6 +46,7 @@
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.11.0",
"mocha": "^6.2.3",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.0",
"rimraf": "^3.0.0",
"rollup": "^0.47.0",
Expand All @@ -58,17 +59,17 @@
"clean:node": "rimraf index.js lib",
"clean:es": "rimraf es",
"clean:browser": "rimraf validator*.js",
"clean": "npm run clean:node && npm run clean:browser && npm run clean:es",
"clean": "run-p clean:*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the same result achieved using a single & and without having to add another dep?

Suggested change
"clean": "run-p clean:*",
"clean": "npm run clean:node & npm run clean:browser & npm run clean:es",

Copy link
Contributor Author

@sachinraja sachinraja Oct 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't work on Windows (with cmd.exe)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, shitty cmd🙃

"minify": "uglifyjs validator.js -o validator.min.js --compress --mangle --comments /Copyright/",
"build:browser": "node --require @babel/register build-browser && npm run minify",
"build:es": "babel src -d es --env-name=es",
"build:node": "babel src -d .",
"build": "npm run build:browser && npm run build:node && npm run build:es",
"build": "run-p build:*",
"pretest": "npm run build && npm run lint",
"test": "nyc --reporter=cobertura --reporter=text-summary mocha --require @babel/register --reporter dot"
},
"engines": {
"node": ">= 0.10"
},
"license": "MIT"
}
}