File size: 598 Bytes
1e92f2d |
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 |
import fs from 'node:fs'
import path from 'node:path'
console.log('Running prepare package script')
/**
* Files to link from the dist directory
* @type {string[]}
*/
const FILES_TO_LINK = ['README.md', 'package.json']
if (!fs.existsSync('dist')) {
fs.mkdirSync('dist', { recursive: true })
}
console.log('Linking files')
for (const fileName of FILES_TO_LINK) {
if (fs.existsSync(fileName)) {
fs.linkSync(fileName, path.join('dist', fileName))
console.log(`${fileName}`)
} else {
console.log(`${fileName} not found, skipping`)
}
}
console.log('prepare package complete')
|