add license file to npm publish (#11705)
This commit is contained in:
parent
39554566cc
commit
4757980f9c
1 changed files with 4 additions and 2 deletions
|
@ -21,7 +21,8 @@ const files = [
|
|||
'index.js',
|
||||
'install.js',
|
||||
'package.json',
|
||||
'README.md'
|
||||
'README.md',
|
||||
'LICENSE'
|
||||
]
|
||||
|
||||
const jsonFields = [
|
||||
|
@ -49,9 +50,10 @@ new Promise((resolve, reject) => {
|
|||
tempDir = dirPath
|
||||
// copy files from `/npm` to temp directory
|
||||
files.forEach((name) => {
|
||||
const noThirdSegment = name === 'README.md' || 'LICENSE'
|
||||
fs.writeFileSync(
|
||||
path.join(tempDir, name),
|
||||
fs.readFileSync(path.join(__dirname, '..', name === 'README.md' ? '' : 'npm', name))
|
||||
fs.readFileSync(path.join(__dirname, '..', noThirdSegment ? '' : 'npm', name))
|
||||
)
|
||||
})
|
||||
// copy from root package.json to temp/package.json
|
||||
|
|
Loading…
Reference in a new issue