Skip to content

Instantly share code, notes, and snippets.

@Paul-Isache
Last active October 21, 2019 15:50
Show Gist options
  • Save Paul-Isache/c43a3727d40357783ad3c0a31fd410ad to your computer and use it in GitHub Desktop.
Save Paul-Isache/c43a3727d40357783ad3c0a31fd410ad to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const packageJSONPath = path.resolve(__dirname, "./package.json");
const packageJSON = require(packageJSONPath);
packageJSON.bundleDependencies = Object.keys(packageJSON.dependencies);
const newPkgContents = JSON.stringify(packageJSON, null, 2);
fs.writeFileSync(packageJSONPath, newPkgContents);
console.log("Updated bundleDependencies");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment