-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
27 lines (24 loc) · 714 Bytes
/
Copy pathbuild.js
File metadata and controls
27 lines (24 loc) · 714 Bytes
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
import browserlist from 'browserslist';
import { build } from 'esbuild';
import { esbuildPluginBrowserslist } from 'esbuild-plugin-browserslist';
import fs from 'fs';
fs.readdirSync('bin').forEach(async f => {
const dir = `./bin/${f}`
const metadata = await import(`${dir}/metadata.js`)
await build({
entryPoints: [`${dir}/main`],
outdir: `dist/${f}`,
bundle: true,
plugins: [
esbuildPluginBrowserslist(browserlist(), { printUnknownTargets: false })
],
legalComments: 'inline',
banner: {
js: metadata.default
}
})
});
process.on('unhandledRejection', (err) => {
console.error(err)
process.exit(1)
})