-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
39 lines (36 loc) · 979 Bytes
/
rollup.config.js
File metadata and controls
39 lines (36 loc) · 979 Bytes
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
import { defineConfig } from "rollup";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import posthtml from "rollup-plugin-posthtml-template";
import css from "rollup-plugin-css-only";
import serve from "rollup-plugin-serve";
import livereload from "rollup-plugin-livereload";
import { terser } from "rollup-plugin-terser";
const production = !process.env.ROLLUP_WATCH;
export default defineConfig({
input: "src/index.js",
output: {
sourcemap: true,
format: "iife",
name: "app",
file: "dist/bundle.js",
},
plugins: [
commonjs(),
resolve({
browser: true,
dedupe: ["dativejs"],
}),
posthtml({
include: ["**/*.{dative.html}"],
}),
production && terser(),
!production &&
serve({
port: 4100,
contentBase: ".",
}),
!production && livereload(),
css({ output: "bundle.css" }),
],
});