2021-11-26 15:14:10 +00:00
|
|
|
/* eslint-disable */
|
|
|
|
const esbuild = require('esbuild')
|
|
|
|
const pkg = require('../package.json')
|
|
|
|
|
2021-12-22 00:14:38 +00:00
|
|
|
const { log: jslog } = console
|
|
|
|
|
2021-11-26 15:14:10 +00:00
|
|
|
async function main() {
|
|
|
|
try {
|
|
|
|
await esbuild.build({
|
|
|
|
entryPoints: ['src/index.tsx'],
|
|
|
|
outfile: 'dist/index.js',
|
|
|
|
bundle: true,
|
|
|
|
minify: false,
|
|
|
|
sourcemap: true,
|
|
|
|
incremental: true,
|
|
|
|
target: ['chrome58', 'firefox57', 'safari11', 'edge18'],
|
|
|
|
define: {
|
|
|
|
'process.env.NODE_ENV': '"development"',
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
onRebuild(err) {
|
2021-12-22 00:14:38 +00:00
|
|
|
err ? error('❌ Failed') : jslog('✅ Updated')
|
2021-11-26 15:14:10 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
} catch (err) {
|
|
|
|
process.exit(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
main()
|