Fix build
This commit is contained in:
parent
fbc81620fb
commit
f2ed16ff7e
3 changed files with 11 additions and 12 deletions
|
@ -36,9 +36,11 @@ async function main() {
|
|||
external: ['react', 'react-dom'],
|
||||
})
|
||||
|
||||
fs.copyFile('./README.md', './dist/README.md', (err) => {
|
||||
if (err) throw err
|
||||
})
|
||||
for (const file of ['package.json', 'README.md']) {
|
||||
fs.copyFile(file, `dist/${file}'`, fs.constants.COPYFILE_EXCL, (err) => {
|
||||
if (err) throw err
|
||||
})
|
||||
}
|
||||
|
||||
console.log(`✔ ${name}: Built package.`)
|
||||
} catch (e) {
|
||||
|
|
|
@ -9,14 +9,6 @@ async function main() {
|
|||
fs.mkdirSync('./dist')
|
||||
}
|
||||
|
||||
fs.copyFileSync('package.json', 'dist/package.json', (err) => {
|
||||
if (err) throw err
|
||||
})
|
||||
|
||||
fs.copyFileSync('README.md', 'dist/README.md', (err) => {
|
||||
if (err) throw err
|
||||
})
|
||||
|
||||
try {
|
||||
esbuild.buildSync({
|
||||
entryPoints: ['./src/index.ts'],
|
||||
|
@ -44,6 +36,12 @@ async function main() {
|
|||
external: ['react', 'react-dom'],
|
||||
})
|
||||
|
||||
for (const file of ['package.json', 'README.md']) {
|
||||
fs.copyFile(file, `dist/${file}'`, fs.constants.COPYFILE_EXCL, (err) => {
|
||||
if (err) throw err
|
||||
})
|
||||
}
|
||||
|
||||
console.log(`✔ ${name}: Built package.`)
|
||||
} catch (e) {
|
||||
console.log(`× ${name}: Build failed due to an error.`)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable */
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const esbuild = require('esbuild')
|
||||
|
||||
async function main() {
|
||||
|
|
Loading…
Reference in a new issue