From 8a646f7fe7a7626b2872feb1ef02820825ad10d8 Mon Sep 17 00:00:00 2001 From: turtledreams <62231246+turtledreams@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:36:03 +0900 Subject: [PATCH] Rollup cf --- .gitignore | 1 - rollup.config.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 rollup.config.js diff --git a/.gitignore b/.gitignore index 31dc032..9951345 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ node_modules/ dist/ -rollup.config.js Countly.d.ts src/ instrumented/ diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..a9e1886 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,50 @@ + +import resolve from "@rollup/plugin-node-resolve"; +import babel from "@rollup/plugin-babel"; + +export default [ + { + input: "./Countly.js", + output: [ + { + file: "dist/countly_esm.js", + format: "esm", + name: "Countly", + sourcemap: true, + exports: "named", + extend: true, + globals: { crypto: "crypto", Countly: "Countly" }, + }, + { + file: "dist/countly_umd.js", + format: "umd", + name: "Countly", + sourcemap: true, + exports: "named", + extend: true, + globals: { crypto: "crypto", Countly: "Countly" }, + }, + { + file: "dist/countly_cjs.js", + format: "cjs", + name: "Countly", + sourcemap: true, + exports: "named", + extend: true, + globals: { crypto: "crypto", Countly: "Countly" }, + }, + ], + plugins: [ + resolve({ + preferBuiltins: true, + }), + babel({ + babelrc: false, + presets: ["@babel/preset-env"], + babelHelpers: "bundled", + // plugins : ["istanbul"] // use for code coverage + }), + ], + } + +]; \ No newline at end of file