-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
48 lines (47 loc) · 1.13 KB
/
rollup.config.mjs
File metadata and controls
48 lines (47 loc) · 1.13 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
// rollup.config.mjs
import typescript from "@rollup/plugin-typescript";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";
export default {
input: "src/index.tsx",
output: [
{
file: "dist/index.js",
format: "cjs", // CommonJS
exports: "named",
sourcemap: true,
},
{
file: "dist/index.es.js",
format: "esm", // ES Module
exports: "named",
sourcemap: true,
},
],
external: ["react", "react-dom", "gsap", "gsap/ScrollTrigger"],
plugins: [
peerDepsExternal(),
nodeResolve({
browser: true,
preferBuiltins: false,
}),
commonjs(),
typescript({
tsconfig: "./tsconfig.json",
declaration: true,
declarationDir: "dist",
exclude: ["**/*.test.*", "**/*.spec.*"],
}),
postcss({
modules: false,
extract: "index.css",
inject: false,
minimize: true,
use: ["sass"],
}),
terser(),
],
};