forked from coreui/coreui-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
42 lines (38 loc) · 1.04 KB
/
rollup.config.js
File metadata and controls
42 lines (38 loc) · 1.04 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
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import postcss from "rollup-plugin-postcss";
import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
const external = ["react", "react-dom", "react-router-dom", "react-dom/server"];
// const external = id => id.includes('@babel/runtime')
const plugins = [
babel({
// Only transpile our source code
exclude: "node_modules/**",
// Include the helpers in the bundle, at most one copy of each
babelHelpers: "runtime",
}),
peerDepsExternal(),
resolve({
// module: true,
// browser: true,
// jsnext: true,
// preferBuiltins: false,
extensions: [".js", ".json", ".jsx"],
dedupe: ["react", "react-dom", "react-router-dom", "react-dom/server"],
}),
commonjs(),
postcss(),
];
const rollupConfig = {
input: `./src/index.js`,
output: {
file: `./lib/index.js`,
format: "cjs",
name: "coreui-react",
inlineDynamicImports: true,
},
external,
plugins,
};
module.exports = rollupConfig;