-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
41 lines (37 loc) · 1.05 KB
/
rollup.config.mjs
File metadata and controls
41 lines (37 loc) · 1.05 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
import postcss from "rollup-plugin-postcss";
import babel from "@rollup/plugin-babel";
//This plugin prevents packages listed in peerDependencies from being bundled with our component library
import peerDepsExternal from "rollup-plugin-peer-deps-external";
//efficiently bundles third party dependencies we've installed and use in node_modules
import resolve from "@rollup/plugin-node-resolve";
// //enables transpilation into CommonJS (CJS) format
import commonjs from "@rollup/plugin-commonjs";
import packageJson from "./package.json" assert { type: "json" };
export default {
input: "./index.js",
output: {
file: packageJson.module,
format: "esm",
sourcemap: true,
},
plugins: [
postcss({
config: {
path: "./postcss.config.js",
},
extensions: [".css"],
minimize: true,
inject: {
insertAt: "top",
},
}),
babel({
babelHelpers: "bundled",
exclude: "node_modules/**",
}),
peerDepsExternal(),
resolve(),
commonjs(),
],
external: ["react", "react-dom"],
};