forked from Elius94/react-photo-sphere-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
43 lines (42 loc) · 1.22 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
41
42
43
import typescript from "@rollup/plugin-typescript"
import commonjs from "@rollup/plugin-commonjs"
import postcss from "rollup-plugin-postcss"
import resolve from "@rollup/plugin-node-resolve"
import url from "@rollup/plugin-url"
import svgr from "@svgr/rollup"
import babel, { getBabelOutputPlugin } from "@rollup/plugin-babel"
export default [{
input: [
"src/index.tsx",
],
output: [
{
dir: "dist",
format: "esm",
exports: "named",
preserveModules: true,
preserveModulesRoot: "src",
sourcemap: true,
}
],
plugins: [
resolve(),
postcss({
modules: false
}),
commonjs(),
url(),
svgr(),
typescript({
tsconfig: "./tsconfig.json",
declaration: true,
declarationDir: "dist",
}),
babel({ exclude: "node_modules/**", presets: ["@babel/preset-react"], babelHelpers: "bundled" }),
getBabelOutputPlugin({
presets: ["@babel/preset-react","@babel/preset-env"],
plugins: [["babel-plugin-styled-components", { displayName: true }]],
}),
],
external: ["react", "react-dom"],
}]