changeset 78:ea9c9db282d6

automate 'external' list, get all local code to appear in lib.bundle.js
author drewp@bigasterisk.com
date Tue, 11 Feb 2020 22:55:24 -0800
parents 0ffe5591b048
children 0c188ed3bcd8
files rollup.config.js
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/rollup.config.js	Tue Feb 11 22:54:47 2020 -0800
+++ b/rollup.config.js	Tue Feb 11 22:55:24 2020 -0800
@@ -12,6 +12,14 @@
   }
 };
 
+const moduleIsntLocal = (id, parentId, isResolved) => {
+  console.log("check", id, !id.startsWith("./"));
+  if (isResolved || id == "src/index.ts") {
+    return false;
+  }
+  return !id.startsWith("./");
+};
+
 export default [
   {
     input: "src/index.ts",
@@ -20,19 +28,12 @@
       format: "esm",
       intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};`
     },
-    external: [
-      "@polymer/polymer",
-      "lit-html",
-      "@polymer/decorators",
-      "n3",
-      "jsonld"
-    ],
+    external: moduleIsntLocal,
     plugins: [
       builtins(),
       resolve({
         extensions: [".js", ".ts"],
         browser: true,
-        resolveOnly: ["streamed-graph"]
       }),
       typescript(),
       postcss({