-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathesbuild.config.js
37 lines (31 loc) · 919 Bytes
/
esbuild.config.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
'use strict'
const path = require('path')
const esbuild = require('esbuild')
const alias = require('esbuild-plugin-alias')
const dev = /^dev/i.test(process.env.NODE_ENV)
const buildConfig = {
entryPoints: {
background: './src/scripts/background/background.ts',
twitter: './src/scripts/mirrorblock/twitter.ts',
twitter_inject: './src/scripts/inject/twitter-inject.ts',
chainblock: './src/scripts/chainblock/chainblock.ts',
popup: './src/popup/popup.ts',
options_ui: './src/options/options.ts',
},
outdir: './build-firefox/bundled',
outExtension: { '.js': '.bun.js' },
bundle: true,
minifyWhitespace: !dev,
minifyIdentifiers: !dev,
minifySyntax: !dev,
sourcemap: true,
}
async function main() {
console.log('<esbuild> building...')
await esbuild.build(buildConfig)
console.log('<esbuild> DONE')
}
module.exports = buildConfig
if (require.main == module) {
main()
}