Mercurial > code > home > repos > streamed-graph
diff rollup.config.js @ 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 | 0ba4bd0ba245 |
children | 0c188ed3bcd8 |
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({