From 62fcd6285f44f0964c57417eab4d84d2c3282c22 Mon Sep 17 00:00:00 2001 From: weboko Date: Thu, 2 Feb 2023 00:31:20 +0100 Subject: [PATCH] test rollup config --- karma.conf.cjs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/karma.conf.cjs b/karma.conf.cjs index b80ee7f..a6c93c9 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -3,7 +3,29 @@ process.env.CHROME_BIN = require("puppeteer").executablePath(); const os = require("os"); const path = require("path"); -const rollupConfig = import("./rollup.config.js"); +const { nodeResolve } = require("@rollup/plugin-node-resolve"); +const commonjs = require("@rollup/plugin-commonjs"); +const json = require("@rollup/plugin-json"); + +const rollupConfig = { + input: { + index: "dist/index.js", + }, + output: { + dir: "bundle", + format: "esm", + }, + plugins: [ + commonjs(), + json(), + nodeResolve({ + browser: true, + preferBuiltins: false, + extensions: [".js", ".ts"], + }), + ], +}; + const output = { path: path.join(os.tmpdir(), "_karma_webpack_") + Math.floor(Math.random() * 1000000),