-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
40 lines (39 loc) · 1.17 KB
/
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
32
33
34
35
36
37
38
39
40
import replace from "@rollup/plugin-replace"
import typescript from "rollup-plugin-typescript2"
import resolve from "rollup-plugin-node-resolve"
import commonJS from "rollup-plugin-commonjs"
export default ["cjs", "es"].map((format) => ({
input: "./client/index.tsx",
output: {
format,
file: `./client/dist/index.${format}.js`,
sourcemap: true,
strict: false,
},
plugins: [
typescript({
tsconfigDefaults: {
include: ["./client/**/*"],
compilerOptions: { declaration: true },
},
}),
replace({
"process.env.npm_package_version": `"${process.env.npm_package_version}"`,
"process.env.GIT_COMMIT": `"${process.env.GIT_COMMIT}"`,
}),
resolve({ browser: true, preferBuiltins: true }),
commonJS({
include: "node_modules/**",
namedExports: {
runtypes: ["Record", "Partial", "Number", "String", "Array", "Static", "Union", "Boolean"],
events: ["EventEmitter"],
},
}),
],
external: ["react", "prop-types", "react-ace", "crypto"],
onwarn: (warning, next) => {
if (warning.code === "CIRCULAR_DEPENDENCY") return
if (warning.code === "EVAL") return
next(warning)
},
}))