-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrollup.config.js
38 lines (37 loc) · 988 Bytes
/
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
import resolve from "@rollup/plugin-node-resolve";
import babel, { getBabelOutputPlugin } from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import jsx from "acorn-jsx";
import typescript from "@rollup/plugin-typescript";
import postcss from "rollup-plugin-postcss";
import copy from "rollup-plugin-copy";
export default {
input: "src/index.tsx",
acornInjectPlugins: [jsx()],
external: "react",
plugins: [
postcss({
extensions: [".css"],
}),
resolve(),
commonjs(),
typescript({ jsx: "preserve" }),
babel({
presets: [["@babel/preset-react", { runtime: "automatic" }]],
babelHelpers: "bundled",
extensions: [".js", ".jsx", ".es6", ".es", ".mjs", ".ts", ".tsx"],
}),
copy({
targets: [{ src: "package.json", dest: "dist" }],
}),
],
output: {
dir: "dist",
format: "esm",
plugins: [
getBabelOutputPlugin({
presets: ["@babel/preset-env"],
}),
],
},
};