-
Notifications
You must be signed in to change notification settings - Fork 12
/
rollup.config.js
50 lines (47 loc) · 1.02 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
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import ts from 'rollup-plugin-typescript2'
import path from 'path';
const version = process.env.VERSION || require('./package.json').version
console.log('path ',
path.resolve(__dirname, 'tsconfig.json')
)
const banner =
'/*!\n' +
' * wgl v' + version + '\n' +
' * (c) 2017-2021 Andrei Kashcha.\n' +
' * Released under the MIT License.\n' +
' */'
export default {
input: 'index.ts',
plugins: [
ts({
check: true,
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
tsconfigOverride: {
compilerOptions: {
sourceMap: true,
declaration: true,
declarationMap: true
}
},
}),
resolve(),
commonjs()
],
output: [
{
format: 'umd',
name: 'wgl',
file: 'build/wgl.js',
sourcemap: true,
// dir: 'build',
banner
},
{
format: 'es',
file: 'build/wgl.module.js',
sourcemap: true,
}
],
}