From ea1b4e876a6fe3c06880fdb985c36e62b2014219 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 5 Jul 2023 11:38:43 -0400 Subject: [PATCH] ci: use custom build config --- rollup.config.ts | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 rollup.config.ts diff --git a/rollup.config.ts b/rollup.config.ts new file mode 100644 index 0000000..8730b41 --- /dev/null +++ b/rollup.config.ts @@ -0,0 +1,67 @@ +// @ts-nocheck +import * as import0 from "@rollup/plugin-json"; +import * as import1 from "@rollup/plugin-node-resolve"; +import * as import2 from "@rollup/plugin-commonjs"; +import * as import3 from "@rollup/plugin-graphql"; +import * as import4 from "@rollup/plugin-image"; +import * as import5 from "@rollup/plugin-yaml"; +import * as import6 from "rollup-plugin-postcss"; +import * as import7 from "rollup-plugin-visualizer"; +import * as import8 from "@rollup/plugin-wasm"; +import * as import9 from "@rollup/plugin-alias"; +import * as import10 from "rollup-plugin-ignore-import"; +export default { + input: "build/index.js", + output: [ + { + file: "lib/index.js", + format: "cjs", + sourcemap: true, + inlineDynamicImports: true, + }, + ], + plugins: [ + import0.default(...([] as const)), + import10.default({ + include: [ + "**/multiSocket/tcpSocket.js", + "**/node-fetch/**", + "**/urkel/lib/file.js", + ], + exclude: [], + }), + import9.default({ + entries: { + timers: "timers-browserify", + stream: "./nop.js", + blgr: "blgr/lib/fs-browser.js", + }, + }), + import1.default( + ...([ + { + browser: true, + preferBuiltins: false, + dedupe: [ + "@lumeweb/libkernel", + "@lumeweb/libweb", + "@lumeweb/libportal", + ], + }, + ] as const), + ), + import2.default( + ...([{ extensions: [".js", ".jsx", ".ts", ".tsx"] }] as const), + ), + import10.default({ + include: [/.*commonjs-external/], + exclude: [], + }), + import3.default(...([] as const)), + import4.default(...([] as const)), + import5.default(...([] as const)), + import6.default(...([{ inject: { insertAt: "top" } }] as const)), + import7.visualizer(...([] as const)), + import8.default(...([{ targetEnv: "auto-inline" }] as const)), + ], +};