-
Notifications
You must be signed in to change notification settings - Fork 5
/
esbuild.mjs
34 lines (31 loc) · 970 Bytes
/
esbuild.mjs
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
import * as esbuild from 'esbuild';
import process from 'node:process'
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import * as fs from 'fs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const pkg = JSON.parse(fs.readFileSync('./package.json'));
await esbuild.build({
entryPoints: [path.resolve(__dirname, './src/videojs-vjstranscribe.js')],
outdir: "dist",
bundle: true,
platform: "browser",
minify: true,
banner: {
js: `/*!
* ${pkg.name}
* @author ${pkg.author}
* @version ${pkg.version}
* @url ${pkg.repository.url}
* Copyright ${new Date().getFullYear()} ${pkg.license} licensed.
*/`,
css: `/**
* ${pkg.name}
* @author ${pkg.author}
* @version ${pkg.version}
* @url ${pkg.repository.url}
* Copyright ${new Date().getFullYear()} ${pkg.license} licensed.
*/`,
}
}).catch(() => process.exit(1));