-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
31 lines (30 loc) · 929 Bytes
/
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
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import { terser } from "rollup-plugin-terser";
export default {
input: "src/components/index.ts", // O arquivo de entrada da sua lib
output: [
{
file: "dist/index.cjs.js", // Output para CommonJS
format: "cjs",
sourcemap: true,
},
{
file: "dist/index.esm.js", // Output para ESModules
format: "esm",
sourcemap: true,
},
],
plugins: [
resolve({
extensions: [".js", ".jsx", ".ts", ".tsx"],
}),
commonjs(),
typescript({
tsconfig: "./tsconfig.json",
}),
terser(), // Opcional: minimiza o bundle
],
external: ["react", "react-dom"], // Exclui as dependências do React do bundle
};