-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrollup.config.js
83 lines (79 loc) · 2.21 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* Copyright (c) 2019 - Convergence Labs, Inc.
*
* This file is part of the Convergence JavaScript Client, which is released
* under the terms of the GNU Lesser General Public License version 3
* (LGPLv3), which is a refinement of the GNU Lesser General Public License
* version 3 (GPLv3). A copy of the both the GPLv3 and the LGPLv3 should have
* been provided along with this file, typically located in the "COPYING" and
* "COPYING.LESSER" files (respectively), which are part of this source code
* package. Alternatively, see <https://www.gnu.org/licenses/gpl-3.0.html> and
* <https://www.gnu.org/licenses/lgpl-3.0.html> for the full text of the GPLv3
* and LGPLv3 licenses, if they were not provided.
*/
import rollupTypescript2 from "rollup-plugin-typescript2";
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import typescript from "typescript";
import json from "rollup-plugin-json";
const commonPlugins = [
resolve({
mainFields: ["module", "main"]
}),
commonjs({include: ['node_modules/**'], exclude: ["*.json"]}),
json(),
];
const input = "src/main/index.ts";
export default [
{
input: input,
output: [
{file: "dist/convergence.js", format: 'cjs', sourcemap: true, exports: "named"},
],
external: [
"rxjs",
"rxjs/operators",
"protobufjs/light",
"long"
],
plugins: [
rollupTypescript2({
typescript: typescript,
rollupCommonJSResolveHack: true,
tsconfigOverride: {
compilerOptions: {
resolveJsonModule: false,
module: "ES2015"
}
}
}),
...commonPlugins
]
},
{
input: input,
output: [
{file: "dist/convergence.esm.js", format: 'es', sourcemap: true, exports: "named"}
],
external: [
"rxjs",
"rxjs/operators",
"protobufjs/light",
"long"
],
plugins: [
rollupTypescript2({
typescript: typescript,
rollupCommonJSResolveHack: true,
tsconfigOverride: {
compilerOptions: {
resolveJsonModule: false,
target: "ES2015",
module: "ES2015"
}
}
}),
...commonPlugins
]
}
];