Created
April 17, 2019 20:52
-
-
Save jonnyparris/6570ce03e4d1110eaf8218927ff1a315 to your computer and use it in GitHub Desktop.
Generated distribution-friendly package.json at dist/package.json (without devDependencies)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const DIST_SCRIPTS = { | |
'start': 'npm run start-main-script' | |
} | |
fs.readFile('package.json', 'utf8', (err, data) => { | |
const distPackage = JSON.parse(data) | |
distPackage['scripts'] = DIST_SCRIPTS | |
delete distPackage['devDependencies'] | |
fs.writeFile('dist/package.json', JSON.stringify(distPackage, null, '\t'), 'utf8', () => { | |
console.info('Generated distribution-friendly package.json at dist/package.json') | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment