Mercurial > code > home > repos > homeauto
annotate service/wifi/rollup.config.js @ 1475:2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
Ignore-this: afcf4436ac3d7b88c0d7fc88de81d8e4
darcs-hash:fccd38a16ce2198e70d94d52598d571aa8da42d0
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Thu, 02 Jan 2020 00:23:36 -0800 |
parents | f91ba30b4f75 |
children | b39d24617a85 |
rev | line source |
---|---|
1474
f91ba30b4f75
build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
1 import builtins from "rollup-plugin-node-builtins"; |
1475
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
2 import commonjs from "@rollup/plugin-commonjs"; |
1474
f91ba30b4f75
build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
3 import resolve from "@rollup/plugin-node-resolve"; |
f91ba30b4f75
build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
4 import typescript from "rollup-plugin-typescript2"; |
1475
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
5 import replace from "@rollup/plugin-replace"; |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
6 |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
7 const workaround_jsonld_module_system_picker = "process = {version: '1.0.0'}"; |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
8 const workaround_some_browser_detector = "global = window"; |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
9 |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
10 // This makes <dom-module> element totally unavailable. I only meant to prune one of the |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
11 // two, but of course why is streamed-graph's node_modules/**/dom-module.js file getting |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
12 // here in the first place? |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
13 const duplicated_line_i_cant_prune = |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
14 "customElements.define('dom-module', DomModule);"; |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
15 const replacements = {}; |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
16 replacements[duplicated_line_i_cant_prune] = ""; |
1474
f91ba30b4f75
build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
17 |
f91ba30b4f75
build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
18 export default { |
1475
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
19 input: "src/index.ts", |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
20 output: { |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
21 file: "build/bundle.js", |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
22 format: "esm", |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
23 intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};`, |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
24 }, |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
25 external: [ |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
26 "dom-module", // don't want two of these in the bundle |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
27 ], |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
28 plugins: [ |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
29 builtins(), |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
30 resolve({ |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
31 extensions: [".js", ".ts"], |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
32 browser: true, |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
33 }), |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
34 typescript(), |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
35 commonjs({ |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
36 namedExports: { |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
37 jsonld: ["expand"], // fixes "expand is not exported by node_modules/jsonld/lib/index.js" |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
38 }, |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
39 }), |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
40 replace({ ...replacements, delimiters: ["", ""] }), |
2e598cbcabf4
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
drewp <drewp@bigasterisk.com>
parents:
1474
diff
changeset
|
41 ], |
1474
f91ba30b4f75
build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff
changeset
|
42 }; |