changeset 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 c16a331f42e5
children 77aa2e9234ed
files package.json rollup.config.js tasks.py
diffstat 3 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/package.json	Thu Jan 09 00:05:32 2020 -0800
+++ b/package.json	Thu Jan 09 00:33:16 2020 -0800
@@ -2,7 +2,7 @@
   "name": "streamed-graph",
   "version": "0.0.2",
   "types": "build/index.d.ts",
-  "module": "build/bundle",
+  "module": "build/lib.bundle",
   "scripts": {
     "build": "rollup -c",
     "build_forever": "rollup -cw",
--- a/rollup.config.js	Thu Jan 09 00:05:32 2020 -0800
+++ b/rollup.config.js	Thu Jan 09 00:33:16 2020 -0800
@@ -16,7 +16,7 @@
   {
     input: "src/index.ts",
     output: {
-      file: "build/bundle.js",
+      file: "build/lib.bundle.js",
       format: "esm",
       intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};`
     },
@@ -40,6 +40,26 @@
       }),
       commonjs(workaround_jsonld_expand_issue)
     ]
+  },{
+    input: "src/index.ts",
+    output: {
+      file: "build/element.bundle.js",
+      format: "esm",
+      intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};`
+    },
+    external: [],
+    plugins: [
+      builtins(),
+      resolve({
+        extensions: [".js", ".ts"],
+        browser: true,
+      }),
+      typescript(),
+      postcss({
+        inject: false
+      }),
+      commonjs(workaround_jsonld_expand_issue)
+    ]
   },
   {
     input: "src/demo.ts",
--- a/tasks.py	Thu Jan 09 00:05:32 2020 -0800
+++ b/tasks.py	Thu Jan 09 00:33:16 2020 -0800
@@ -27,5 +27,4 @@
 
 @task(pre=[build])
 def install(ctx):
-    ctx.run(f'cp build/bundle.js         /my/site/homepage/www/rdf/streamed-graph.bundle.js')
-    ctx.run(f'cp src/streamed-graph.css  /my/site/homepage/www/rdf/streamed-graph.css')
+    ctx.run(f'cp build/element.bundle.js /my/site/homepage/www/rdf/streamed-graph.bundle.js')