1234567891011121314151617181920 |
- #!/usr/bin/env node
- const { filter } = require('../dist/object');
- const ignoredFields = [
- 'private',
- 'devDependencies',
- 'scripts',
- 'babel'
- ];
- const isNotIgnored = (key, value) => ignoredFields.indexOf(key) < 0;
- const sourceFileContent = require('../package.json');
- const targetFileContent = filter(sourceFileContent, isNotIgnored);
- const { writeFileSync } = require('fs');
- const targetFilename = 'dist/package.json';
- writeFileSync(targetFilename, JSON.stringify(targetFileContent, null, 3));
|