1 | import typescriptPlugin from 'rollup-plugin-typescript2';
|
2 | import typescript from 'typescript';
|
3 |
|
4 | const globals = {
|
5 | __proto__: null,
|
6 | tslib: "tslib",
|
7 | };
|
8 |
|
9 | function external(id) {
|
10 | return id in globals;
|
11 | }
|
12 |
|
13 | export default [{
|
14 | input: "src/context.ts",
|
15 | external,
|
16 | output: {
|
17 | file: "lib/context.esm.js",
|
18 | format: "esm",
|
19 | sourcemap: true,
|
20 | globals,
|
21 | },
|
22 | plugins: [
|
23 | typescriptPlugin({
|
24 | typescript,
|
25 | tsconfig: "./tsconfig.rollup.json",
|
26 | }),
|
27 | ],
|
28 | }, {
|
29 | input: "lib/context.esm.js",
|
30 | external,
|
31 | output: {
|
32 |
|
33 | file: "lib/context.js",
|
34 | format: "cjs",
|
35 | exports: "named",
|
36 | sourcemap: true,
|
37 | name: "context",
|
38 | globals,
|
39 | },
|
40 | }];
|