Skip to content

Commit

Permalink
Patch package.json dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Sep 14, 2022
1 parent 5899d35 commit 604e830
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cd espree
sed -i 's#external#//external#g' rollup.config.js # Remove external dependencies so all gets packaged into one file
npm install
npm run build
node ../patch.js `pwd`/package.json # Patch dependencies from package.json
npm pack
cd ..
cp espree/espree-${VERSION}.tgz .
Expand Down
15 changes: 15 additions & 0 deletions patch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const file = process.argv[2];

if (!file) {
process.exit(1);
}

const package = require(file);
const { writeFileSync } = require('fs');

package.dependencies = {};
package.devDependencies = {};

console.log(package);

writeFileSync(file, JSON.stringify(package, null, 2));

0 comments on commit 604e830

Please sign in to comment.