-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
53 lines (52 loc) · 1.32 KB
/
rollup.config.js
File metadata and controls
53 lines (52 loc) · 1.32 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import terser from '@rollup/plugin-terser';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve'; // Resolve node_modules
import commonjs from '@rollup/plugin-commonjs'; // Handle UMD/CommonJS
export default [
{
input: 'src/index.js',
output: {
file: 'build/tt.js',
format: 'iife',
name: 'TinyTag', // Changed to avoid overriding window.tt
sourcemap: false
},
plugins: [
json(),
terser({
compress: {
drop_console: true,
pure_funcs: ['console.log'],
dead_code: true,
drop_debugger: true,
conditionals: true,
unused: true,
toplevel: true,
passes: 3
},
mangle: { toplevel: true },
output: { comments: false }
})
]
},
{
input: 'src/rudder-compat.js',
output: {
file: 'build/tt-rudder-compat.js',
format: 'iife',
name: 'TinyTagRudderCompat',
sourcemap: false
},
plugins: [
nodeResolve({
browser: true // Resolve for browser environment
}),
commonjs(),
terser({
compress: { drop_console: true, pure_funcs: ['console.log'], passes: 3 },
mangle: { toplevel: true },
output: { comments: false }
})
]
}
];