-
Notifications
You must be signed in to change notification settings - Fork 9
/
rollup.config.js
52 lines (50 loc) · 1.14 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
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import multi from 'rollup-plugin-multi-input';
import {version} from './package.json';
export default [
{
input: 'src/index.ts',
output: [
{
file: 'dist/bundles/umd/base.js',
format: 'umd',
name: 'CldUrlGen',
},
],
plugins: [
json(),
resolve(),
replace({
'PACKAGE_VERSION_INJECTED_DURING_BUILD': version,
preventAssignment: true
}),
typescript({ target: 'es5' }),
commonjs(),
],
},
{
input: 'src/**/*.ts',
output: {
format: 'cjs',
dir: 'dist',
entryFileNames: '[name].cjs',
chunkFileNames: '[name]-[hash].cjs',
exports: 'auto',
},
plugins: [
multi(),
json(),
resolve(),
replace({
'PACKAGE_VERSION_INJECTED_DURING_BUILD': version,
preventAssignment: true
}),
typescript({ target: "es5" }),
commonjs()
]
}
];