-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bundle.ts
28 lines (25 loc) · 1000 Bytes
/
bundle.ts
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
import { baseBuildDir } from './build/config.ts'
Deno.copyFileSync('LICENSE', `${baseBuildDir}/LICENSE`)
Deno.copyFileSync('README.md', `${baseBuildDir}/README.md`)
console.time('Browser build time')
const browserBuild = new Deno.Command('bun', {
args: ['run', './build/browser-build.ts'],
})
const browserBuildCommandOutput = browserBuild.outputSync()
if (browserBuildCommandOutput.success === false) {
const errMsg = new TextDecoder().decode(browserBuildCommandOutput.stderr)
console.error(errMsg)
throw new Error(`Browser build failed: ${errMsg}`)
}
console.timeEnd('Browser build time')
console.time('Bun build time')
const bunBuild = new Deno.Command('bun', {
args: ['run', './build/bun-build.ts'],
})
const bunBuildCommandOutput = bunBuild.outputSync()
if (bunBuildCommandOutput.success === false) {
const errMsg = new TextDecoder().decode(bunBuildCommandOutput.stderr)
console.error(errMsg)
throw new Error(`Bun build failed: ${errMsg}`)
}
console.timeEnd('Bun build time')