-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.dev.js
55 lines (53 loc) · 1.43 KB
/
rollup.config.dev.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
44
45
46
47
48
49
50
51
52
53
54
55
import commonjs from "rollup-plugin-commonjs";
import livereload from "rollup-plugin-livereload";
import postcss from "rollup-plugin-postcss";
// import replace from "rollup-plugin-replace";
import resolve from "rollup-plugin-node-resolve";
import serve from "rollup-plugin-serve";
import tsplugin from "rollup-plugin-typescript2";
import image from "rollup-plugin-inline-image";
export default {
input: "./examples/examples.tsx",
output: {
file: "dist/examples.bundle.js",
format: "iife",
sourcemap: true,
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
external: ["react", "react-dom"],
plugins: [
// replace({
// "process.env.NODE_ENV": JSON.stringify("development"),
// }),
image(),
resolve(),
commonjs({
// NOTE: this need react, react-dom been install into the dependency section in `package.json`, or rollup won't find the two libs
// include: ["node_modules/**"],
// namedExports: {
// "node_modules/react/index.js": ["Children", "Component", "PropTypes", "createElement"],
// "node_modules/react-dom/index.js": ["render"],
// },
}),
postcss({
modules: false,
}),
tsplugin({
clean: true,
tsconfigOverride: {
compilerOptions: {
declaration: false,
},
},
}),
serve({
open: true,
port: 3000,
contentBase: "./",
}),
livereload(),
],
};