-
Notifications
You must be signed in to change notification settings - Fork 725
/
rollup.config.js
46 lines (39 loc) · 957 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
39
40
41
42
43
44
45
46
import fs from 'fs';
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';
import license from './utils/license-template.js';
const { version } = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url)));
const input = './src/index.js';
const name = 'glMatrix';
const bannerPlugin = {
banner: `/*!
@fileoverview gl-matrix - High performance matrix and vector operations
@author Brandon Jones
@author Colin MacKenzie IV
@version ${version}
${license}
*/`
}
export default [
{
input,
output: { file: 'dist/gl-matrix.js', format: 'umd', name },
plugins: [
bannerPlugin,
babel()
]
},
{
input,
output: { file: 'dist/gl-matrix-min.js', format: 'umd', name },
plugins: [
bannerPlugin,
babel(),
sizeSnapshot(),
terser({
output: { comments: /^!/ }
})
]
}
];