-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
31 lines (27 loc) · 1.09 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const commonjs = require('@rollup/plugin-commonjs');
const resolve = require('@rollup/plugin-node-resolve');
const typescript = require('rollup-plugin-typescript2');
const json = require('@rollup/plugin-json');
const terser = require('@rollup/plugin-terser'); // Make sure to import terser correctly
module.exports = {
input: 'index.ts', // Adjust path if necessary
output: {
file: 'dist/clickstream.umd.js', // Output bundle file
format: 'umd', // UMD format
name: 'Clickstream', // Global variable name
sourcemap: true, // Generate sourcemap for debugging
},
plugins: [
resolve({
browser: true, // Resolve modules for browser environments
preferBuiltins: false, // Prevent Rollup from prioritizing Node.js built-ins for the browser
}),
commonjs({
include: ['node_modules/**','node_modules/@gofynd/fp-signature/**'],
sourceMap: true,
}),
json(), // Convert CommonJS to ES6
typescript({ tsconfig: './tsconfig.json' }), // Use tsconfig
terser() // Minify the output,
]
};