-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostbump.cjs
39 lines (34 loc) · 838 Bytes
/
postbump.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const writePackage = (json, dest) => {
fs.writeFileSync(path.resolve(__dirname, dest), JSON.stringify(json, null, 2));
};
const copyFile = (src, dest) => {
fs.copyFileSync(src, path.resolve(__dirname, dest));
};
const rootPkg = require('./package.json');
writePackage(
{
...rootPkg,
engines: undefined,
files: undefined,
main: 'index.js',
// main: 'cjs/index.js',
// module: 'esm/index.js',
// types: 'types/index.d.js',
husky: undefined,
'lint-staged': undefined,
scripts: undefined,
'standard-version': undefined
},
'dist/package.json'
);
copyFile('LICENSE', 'dist/LICENSE');
copyFile('README.md', 'dist/README.md');
// writePackage(
// {
// type: 'module'
// },
// 'dist/esm/package.json'
// );