-
Notifications
You must be signed in to change notification settings - Fork 15
/
rollup.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
const resolve = require("rollup-plugin-node-resolve");
const babel = require("rollup-plugin-babel");
const commonjs = require("rollup-plugin-commonjs");
const { terser } = require("rollup-plugin-terser");
const isProduction = process.env.NODE_ENV === "production";
module.exports = {
input: "src/index.js",
output: {
file: "./dist/index.js",
format: "cjs",
},
plugins: [
resolve({
// pass custom options to the resolve plugin
customResolveOptions: {
moduleDirectory: "node_modules",
},
}),
babel({
exclude: "node_modules/**", // only transpile our source code
}),
commonjs({
include: "node_modules/**",
namedExports: {},
}),
// production plugins
...(isProduction ? [terser()] : []),
],
external: [
"browser-or-node",
"lg-autoplay.js",
"lg-fullscreen.js",
"lg-hash.js",
"lg-pager.js",
"lg-share.js",
"lg-thumbnail.js",
"lg-video.js",
"lg-zoom.js",
"lightgallery.js",
"prop-types",
"react",
"react-dom",
"uniqid",
],
inlineDynamicImports: true,
};