-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-bundle.js
More file actions
42 lines (36 loc) · 979 Bytes
/
Copy pathbuild-bundle.js
File metadata and controls
42 lines (36 loc) · 979 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env node
/**
* Build script to bundle the validator and browser apps into JS files
*/
import * as esbuild from 'esbuild';
// Build validator bundle (used by app.ts as global ModValidator object)
await esbuild.build({
entryPoints: ['src/index.ts'],
bundle: true,
outfile: 'public/validator.bundle.js',
format: 'iife',
globalName: 'ModValidator',
platform: 'browser',
target: 'es2020',
loader: {
'.json': 'json',
},
sourcemap: true,
minify: false, // Set to true for production
});
console.log('✅ Bundle created: public/validator.bundle.js');
// Build main app bundle (includes all page modules)
await esbuild.build({
entryPoints: ['src/pages/index.ts'],
bundle: true,
outfile: 'public/app.bundle.js',
format: 'iife',
platform: 'browser',
target: 'es2020',
loader: {
'.json': 'json',
},
sourcemap: true,
minify: false, // Set to true for production
});
console.log('✅ Bundle created: public/app.bundle.js');