-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
43 lines (39 loc) · 1010 Bytes
/
rollup.config.js
File metadata and controls
43 lines (39 loc) · 1010 Bytes
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
/**
* TinyPine.js Rollup Configuration
* Builds ESM, CJS, and IIFE (browser) versions
*/
import { terser } from "@rollup/plugin-terser";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
const isProduction = process.env.NODE_ENV === "production";
const outputConfig = {
format: "iife",
name: "TinyPine",
sourcemap: !isProduction,
};
export default [
// Browser IIFE build (minified)
{
input: "src/index.js",
output: {
...outputConfig,
file: "dist/tinypine.min.js",
},
plugins: [
nodeResolve(),
commonjs(),
terser({
compress: {
drop_console: false,
passes: 3,
},
mangle: {
toplevel: true,
},
format: {
comments: false,
},
}),
],
},
];