-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
73 lines (69 loc) · 1.73 KB
/
rollup.config.mjs
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import terser from "@rollup/plugin-terser";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import babel from "@rollup/plugin-babel";
const babelProd = {
exclude: "node_modules/**",
plugins: ["@babel/plugin-transform-react-jsx"],
babelHelpers: "bundled",
};
const warn = {
onwarn(warning, warn) {
// ignores any 'use client' directive warnings
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
return;
}
warn(warning);
},
};
export default [
{
input: "./public/oauth-callback.js",
output: {
file: "./public/dist/oauth-callback.js",
format: "esm",
},
plugins: [nodeResolve(), commonjs(), typescript(), babel(babelProd)],
...warn,
},
{
input: "./public/hosted-main.js",
output: {
file: "./public/dist/hosted-main.js",
format: "esm",
inlineDynamicImports: true,
},
plugins: [
nodeResolve(),
commonjs(),
typescript(),
babel({
exclude: "node_modules/**",
plugins: ["@babel/plugin-transform-react-jsx-development"],
babelHelpers: "bundled",
}),
],
...warn,
},
{
input: "./public/hosted-main.js",
output: {
file: "./public/dist/hosted-main.min.js",
format: "esm",
inlineDynamicImports: true,
},
plugins: [nodeResolve(), commonjs(), terser(), typescript(), babel(babelProd)],
...warn,
},
{
input: "./public/connect-main.js",
output: {
file: "./public/dist/connect-main.min.js",
format: "esm",
inlineDynamicImports: true,
},
plugins: [nodeResolve(), commonjs(), typescript(), babel(babelProd)],
...warn,
},
];