-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
31 lines (30 loc) · 872 Bytes
/
rollup.config.js
File metadata and controls
31 lines (30 loc) · 872 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
import typescript from "@rollup/plugin-typescript";
import pkg from "./package.json";
export default [
// - CommonJS (for Node)
// - ES module (for bundlers)
// - UMD (for browser)
{
input: "src/index.ts",
external: ["react","axios"],
output: [
// NOTE: interop: false is deprecated.
// When we upgrade need to identify best path forward to avoid bloat.
{ file: pkg.main, format: "cjs", sourcemap: true, interop: false },
{ file: pkg.module, format: "es", sourcemap: true },
{
name: "react-file-hooks",
file: pkg.unpkg,
format: "umd",
sourcemap: true,
globals: {
react: 'React',
axios: 'Axios'
},
interop: false,
}
],
// ts definition outputs specified in config
plugins: [typescript({ tsconfig: './tsconfig.json' })],
},
];