2021-08-30 18:10:30 +00:00
|
|
|
/* eslint-disable */
|
|
|
|
const fs = require('fs')
|
|
|
|
const esbuild = require('esbuild')
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
if (fs.existsSync('./dist')) {
|
2021-09-02 12:51:39 +00:00
|
|
|
fs.rmSync('./dist', { recursive: true }, (e) => {
|
|
|
|
if (e) {
|
|
|
|
throw e
|
|
|
|
}
|
|
|
|
})
|
2021-08-30 18:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
esbuild.build({
|
|
|
|
entryPoints: ['./src/index.ts'],
|
|
|
|
outdir: 'dist/cjs',
|
|
|
|
minify: false,
|
|
|
|
bundle: true,
|
|
|
|
format: 'cjs',
|
|
|
|
target: 'es6',
|
|
|
|
jsxFactory: 'React.createElement',
|
|
|
|
jsxFragment: 'React.Fragment',
|
|
|
|
tsconfig: './tsconfig.json',
|
|
|
|
external: ['react', 'react-dom'],
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
main()
|