-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
49 lines (46 loc) · 1.19 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
import nodeResolve from '@rollup/plugin-node-resolve';
import commonJs from '@rollup/plugin-commonjs';
import license from 'rollup-plugin-license';
// Run license() here, not in the objects of the exported
// array. Otherwise, the third party licence file gets
// overwritten, not appended to.
let licensePlugin = license({
banner: { content: { file: 'license.md' } },
thirdParty: {
output: 'license-3rd-party',
includePrivate: true
}
});
export default [{
input: 'src/SampleDB.client.js',
output: {
file: 'dist/SampleDB.client.js',
format: 'esm'
},
plugins: licensePlugin
}, {
input: 'src/SampleDB.server.js',
output: {
file: 'dist/SampleDB.server.js',
format: 'cjs'
},
plugins: licensePlugin
}, {
input: 'src/SampleDB.idb.js',
output: {
file: 'dist/SampleDB.idb.js',
format: 'esm'
},
plugins: [
nodeResolve({ jsnext: true }),
commonJs({ include: 'node_modules/**' }),
licensePlugin
],
}, {
input: 'src/SampleDB.mongo.js',
output: {
file: 'dist/SampleDB.mongo.js',
format: 'cjs'
},
plugins: [commonJs(), licensePlugin]
}];