forked from jfbeats/ArweaveWalletConnector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
39 lines (35 loc) · 797 Bytes
/
build.js
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
28
29
30
31
32
33
34
35
36
37
38
39
import { build } from 'esbuild'
import rimraf from 'rimraf'
const clean = async () => {
return new Promise(resolve => {
rimraf('./dist', () => resolve())
})
}
export const runBuild = async (doClean = false) => {
if (doClean) await clean()
build({
entryPoints: ['./src/index.ts'],
minify: false,
bundle: true,
platform: 'browser',
target: ['chrome58', 'firefox57', 'safari11', 'edge18'],
outfile: './dist/index.js',
sourcemap: true
}).catch((e) => {
console.log(e)
process.exit(1)
})
build({
entryPoints: ['./src/index.ts'],
minify: true,
bundle: true,
platform: 'browser',
target: ['chrome58', 'firefox57', 'safari11', 'edge18'],
outfile: './dist/index.min.js',
sourcemap: true
}).catch((e) => {
console.log(e)
process.exit(1)
})
}
runBuild(true)