Mercurial > code > home > repos > streamed-graph
annotate rollup.config.js @ 50:1264ba9ffb10
make a full-element version for pages that want to try to use that
author | drewp@bigasterisk.com |
---|---|
date | Thu, 09 Jan 2020 00:33:16 -0800 |
parents | b8e5850acca0 |
children | 5b8685d95bf4 |
rev | line source |
---|---|
35 | 1 import builtins from "rollup-plugin-node-builtins"; |
47 | 2 import commonjs from "@rollup/plugin-commonjs"; |
48 | 3 import postcss from "rollup-plugin-postcss"; |
34 | 4 import resolve from "@rollup/plugin-node-resolve"; |
5 import typescript from "rollup-plugin-typescript2"; | |
6 | |
48 | 7 const workaround_jsonld_module_system_picker = "process = {version: '1.0.0'}"; |
8 const workaround_some_browser_detector = "global = window"; | |
9 const workaround_jsonld_expand_issue = { | |
10 namedExports: { | |
11 jsonld: ["expand"] // fixes "expand is not exported by node_modules/jsonld/lib/index.js" | |
12 } | |
13 }; | |
14 | |
15 export default [ | |
16 { | |
35 | 17 input: "src/index.ts", |
18 output: { | |
50
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
19 file: "build/lib.bundle.js", |
48 | 20 format: "esm", |
21 intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};` | |
35 | 22 }, |
48 | 23 external: [ |
24 "@polymer/polymer", | |
25 "lit-html", | |
26 "@polymer/decorators", | |
27 "n3", | |
28 "jsonld" | |
29 ], | |
35 | 30 plugins: [ |
48 | 31 builtins(), |
32 resolve({ | |
33 extensions: [".js", ".ts"], | |
34 browser: true, | |
35 only: ["streamed-graph"] | |
36 }), | |
37 typescript(), | |
38 postcss({ | |
39 inject: false | |
40 }), | |
41 commonjs(workaround_jsonld_expand_issue) | |
35 | 42 ] |
50
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
43 },{ |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
44 input: "src/index.ts", |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
45 output: { |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
46 file: "build/element.bundle.js", |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
47 format: "esm", |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
48 intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};` |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
49 }, |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
50 external: [], |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
51 plugins: [ |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
52 builtins(), |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
53 resolve({ |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
54 extensions: [".js", ".ts"], |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
55 browser: true, |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
56 }), |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
57 typescript(), |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
58 postcss({ |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
59 inject: false |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
60 }), |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
61 commonjs(workaround_jsonld_expand_issue) |
1264ba9ffb10
make a full-element version for pages that want to try to use that
drewp@bigasterisk.com
parents:
48
diff
changeset
|
62 ] |
48 | 63 }, |
64 { | |
65 input: "src/demo.ts", | |
66 output: { | |
67 file: "build/demo.js", | |
68 format: "esm", | |
69 intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};` | |
70 }, | |
71 external: [], | |
72 plugins: [ | |
73 builtins(), | |
74 resolve({ | |
75 extensions: [".js", ".ts"], | |
76 browser: true | |
77 }), | |
78 typescript(), | |
79 postcss({ | |
80 inject: false | |
81 }), | |
82 commonjs(workaround_jsonld_expand_issue) | |
83 ] | |
84 } | |
85 ]; |