annotate service/wifi/rollup.config.js @ 1485:62be73d368df

fixes for streamedgraph build and a surprise with multi-value wifiBands Ignore-this: eea822327a0c66c4462ffd7c404079e5 darcs-hash:9341cc7bcc320e6ef7da3c79e9e3cd3c279bebb6
author drewp <drewp@bigasterisk.com>
date Thu, 09 Jan 2020 00:38:59 -0800
parents 2e598cbcabf4
children b267511ec4fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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";
1485
62be73d368df fixes for streamedgraph build and a surprise with multi-value wifiBands
drewp <drewp@bigasterisk.com>
parents: 1475
diff changeset
9 const workaround_jsonld_expand_issue = {
62be73d368df fixes for streamedgraph build and a surprise with multi-value wifiBands
drewp <drewp@bigasterisk.com>
parents: 1475
diff changeset
10 namedExports: {
62be73d368df fixes for streamedgraph build and a surprise with multi-value wifiBands
drewp <drewp@bigasterisk.com>
parents: 1475
diff changeset
11 jsonld: ["expand"], // fixes "expand is not exported by node_modules/jsonld/lib/index.js"
62be73d368df fixes for streamedgraph build and a surprise with multi-value wifiBands
drewp <drewp@bigasterisk.com>
parents: 1475
diff changeset
12 '../../../streamed-graph/node_modules/jsonld/lib/index': ['expand'],
62be73d368df fixes for streamedgraph build and a surprise with multi-value wifiBands
drewp <drewp@bigasterisk.com>
parents: 1475
diff changeset
13 }
62be73d368df fixes for streamedgraph build and a surprise with multi-value wifiBands
drewp <drewp@bigasterisk.com>
parents: 1475
diff changeset
14 };
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
15
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 // 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
17 // 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
18 // 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
19 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
20 "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
21 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
22 replacements[duplicated_line_i_cant_prune] = "";
1474
f91ba30b4f75 build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff changeset
23
f91ba30b4f75 build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff changeset
24 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
25 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
26 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
27 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
28 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
29 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
30 },
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 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
32 "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
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 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
35 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
36 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
37 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
38 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
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 typescript(),
1485
62be73d368df fixes for streamedgraph build and a surprise with multi-value wifiBands
drewp <drewp@bigasterisk.com>
parents: 1475
diff changeset
41 commonjs(workaround_jsonld_expand_issue),
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
42 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
43 ],
1474
f91ba30b4f75 build adjustments. now seems to read streamedgraph correctly.
drewp <drewp@bigasterisk.com>
parents:
diff changeset
44 };