forked from greggman/wgpu-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
38 lines (35 loc) · 932 Bytes
/
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
import typescript from '@rollup/plugin-typescript';
import fs from 'fs';
const pkg = JSON.parse(fs.readFileSync('package.json', {encoding: 'utf8'}));
const banner = `/* wgpu-matrix@${pkg.version}, license MIT */`;
const ver = `${/^(\d+)\./.exec(pkg.version)[1]}.x`;
const plugins = [
typescript({ tsconfig: './tsconfig.json' }),
];
export default [
{
input: 'src/wgpu-matrix.ts',
output: [
{
file: `dist/${ver}/wgpu-matrix.module.js`,
format: 'esm',
sourcemap: true,
banner,
},
],
plugins,
},
{
input: 'src/wgpu-matrix.ts',
output: [
{
name: 'wgpuMatrix',
file: `dist/${ver}/wgpu-matrix.js`,
format: 'umd',
sourcemap: true,
banner,
},
],
plugins,
},
];