create-commonjs-package-json.js 358 B

1234567891011
  1. // Creates a `package.json` file in the CommonJS `build` folder.
  2. // That marks that whole folder as CommonJS so that Node.js doesn't complain
  3. // about `require()`-ing those files.
  4. import fs from 'fs'
  5. fs.writeFileSync('./build/package.json', JSON.stringify({
  6. name: 'libphonenumber-js/build',
  7. type: 'commonjs',
  8. private: true
  9. }, null, 2), 'utf8')