-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
70 lines (66 loc) · 1.47 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import autoprefixer from "autoprefixer";
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import copy from "rollup-plugin-copy";
import eslint from "@rollup/plugin-eslint";
import postcss from "rollup-plugin-postcss";
import resolve from "@rollup/plugin-node-resolve";
import scss from "rollup-plugin-scss";
import { terser } from "rollup-plugin-terser";
const prod = process.env.NODE_ENV === "production";
const copyTargets = [
{
src: [
"./node_modules/reveal.js/dist/reveal.css",
"./node_modules/reveal.js/dist/reset.css",
],
dest: "./css",
},
{
src: "./node_modules/reveal.js/dist/theme",
dest: "./css",
},
{
src: "./node_modules/reveal.js/dist/reveal.js",
dest: "./js",
},
{
src: "./node_modules/reveal.js/plugin/**/*",
dest: "./plugin",
},
];
const plugins = [
resolve(),
commonjs(),
eslint({
fix: true,
exclude: ["./node_modules/**", "./stylesheets/**"],
}),
babel({
exclude: "node_modules/**",
babelHelpers: "bundled",
}),
prod && terser(),
scss(),
postcss({
plugins: [autoprefixer()],
extract: true,
sourceMap: prod ? false : "inline",
minimize: prod,
}),
copy({
targets: copyTargets,
}),
];
export default [
{
input: "js/revealjs-starter",
output: {
file: "out/revealjs-starter.js",
format: "esm",
name: "Reveal.js Starter",
sourcemap: prod ? false : "inline",
},
plugins: plugins,
},
];