-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrollup.config.js
48 lines (46 loc) · 1.23 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
44
45
46
47
48
import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";
import postcss from "rollup-plugin-postcss";
const extensions = [".js", ".jsx", ".ts", ".tsx"];
/** @type {import('rollup').RollupOptions} */
const options = {
input: "src/index.js",
output: [
{
file: "dist/index.js",
format: "cjs",
// sourcemap: true
},
{
file: "dist/index.es.js",
format: "esm",
// sourcemap: true
},
],
plugins: [
resolve({
extensions,
}),
commonjs(),
babel({
extensions,
}),
postcss({
// Extract CSS to the same location where JS file is generated but with .css extension.
extract: true,
// Use named exports alongside default export.
namedExports: true,
// Minimize CSS, boolean or options for cssnano.
minimize: true,
// Enable sourceMap.
sourceMap: true,
// This plugin will process files ending with these extensions and the extensions supported by custom loaders.
extensions: [".less", ".css"],
}),
// terser(),
],
external: ["react","react-select"],
};
export default options;