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