-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrollup.config.js
57 lines (53 loc) · 1.18 KB
/
rollup.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import json from '@rollup/plugin-json';
import addCliEntry from './add-cli-entry';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import sucrase from '@rollup/plugin-sucrase';
import copy from 'rollup-plugin-copy';
import dts from 'rollup-plugin-dts';
import pkg from './package.json';
const plugins = [
json(),
resolve(),
commonjs({ ignoreDynamicRequires: true }),
sucrase({ transforms: ['typescript'] }),
addCliEntry(),
copy({
targets: [
{
src: 'src/libs/basis_encoder.wasm',
dest: 'dist/',
},
],
}),
];
export default [
{
input: 'src/main.ts',
output: [
{
name: 'GLTFGPUCompressedTexture',
file: pkg.browser,
format: 'umd',
},
{ file: pkg.main, format: 'cjs', exports: 'auto' },
{ file: pkg.module, format: 'es' },
],
plugins,
},
{
input: 'src/main-cli.ts',
output: {
file: pkg.bin['gltf-tc'],
format: 'cjs',
exports: 'auto',
},
external: ['gltf-pipeline'],
plugins,
},
{
input: 'src/main.ts',
output: [{ file: 'types/gltf-tc.d.ts', format: 'es' }],
plugins: [dts()],
},
];