Skip to content

Commit

Permalink
Fix direct npm install
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Mar 6, 2022
1 parent c1a322b commit b5b74aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 3 additions & 5 deletions package.json
Expand Up @@ -9,7 +9,7 @@
"rollup": "dist/bin/rollup"
},
"scripts": {
"build": "shx rm -rf dist && git rev-parse HEAD > .commithash && rollup --config rollup.config.ts --configPlugin typescript && shx cp src/rollup/types.d.ts dist/rollup.d.ts && shx chmod a+x dist/bin/rollup",
"build": "shx rm -rf dist && node scripts/update-git-commit.js && rollup --config rollup.config.ts --configPlugin typescript && shx cp src/rollup/types.d.ts dist/rollup.d.ts && shx chmod a+x dist/bin/rollup",
"build:cjs": "shx rm -rf dist && rollup --config rollup.config.ts --configPlugin typescript --configTest && shx cp src/rollup/types.d.ts dist/rollup.d.ts && shx chmod a+x dist/bin/rollup",
"build:bootstrap": "node dist/bin/rollup --config rollup.config.ts --configPlugin typescript && shx cp src/rollup/types.d.ts dist/rollup.d.ts && shx chmod a+x dist/bin/rollup",
"ci:lint": "npm run lint:nofix",
Expand All @@ -22,10 +22,9 @@
"perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
"perf:debug": "node --inspect-brk scripts/perf-debug.js",
"perf:init": "node scripts/perf-init.js",
"postinstall": "husky install",
"postpublish": "pinst --enable && git push && git push --tags",
"postpublish": "git push && git push --tags",
"prepare": "husky install && npm run build",
"prepublishOnly": "pinst --disable && npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
"prepublishOnly": "npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
"security": "npm audit",
"test": "npm run build && npm run test:all",
"test:cjs": "npm run build:cjs && npm run test:only",
Expand Down Expand Up @@ -97,7 +96,6 @@
"magic-string": "^0.25.7",
"mocha": "^9.2.1",
"nyc": "^15.1.0",
"pinst": "^3.0.0",
"prettier": "^2.5.1",
"pretty-bytes": "^5.6.0",
"pretty-ms": "^7.0.1",
Expand Down
12 changes: 12 additions & 0 deletions scripts/update-git-commit.js
@@ -0,0 +1,12 @@
const { execSync } = require('child_process');
const { writeFileSync } = require('fs');
const { join } = require('path');

let revision;
try {
revision = execSync('git rev-parse HEAD').toString().trim();
} catch (e) {
console.warn('Could not determine git commit when building Rollup.');
revision = '(could not be determined)';
}
writeFileSync(join(__dirname, '../.commithash'), revision);

0 comments on commit b5b74aa

Please sign in to comment.