-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathbuild.js
More file actions
29 lines (27 loc) · 941 Bytes
/
build.js
File metadata and controls
29 lines (27 loc) · 941 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
import * as esbuild from 'esbuild';
// CDN用: gaussian-splats-3d を外部依存のまま
await esbuild.build({
entryPoints: ['gvrm-format/gvrm.js'],
bundle: true,
minify: true,
format: 'esm',
outfile: 'lib/gaussian-vrm.min.js',
external: ['three', 'three/*', '@pixiv/three-vrm', 'jszip', 'gaussian-splats-3d'],
});
console.log('Build complete: lib/gaussian-vrm.min.js (CDN)');
// npm用: gaussian-splats-3d を含める
await esbuild.build({
entryPoints: ['gvrm-format/gvrm.js'],
bundle: true,
minify: true,
format: 'esm',
outfile: 'lib/gaussian-vrm.bundled.js',
external: ['three', 'three/*', '@pixiv/three-vrm', 'jszip'],
alias: {
'gaussian-splats-3d': './lib/gaussian-splats-3d.module.js',
},
banner: {
js: '// @naruya/gaussian-vrm - https://github.com/naruya/gaussian-vrm\n// Includes gaussian-splats-3d (MIT License)',
},
});
console.log('Build complete: lib/gaussian-vrm.bundled.js (npm)');