-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
57 lines (56 loc) · 1.46 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
import babel from "@rollup/plugin-babel";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import replace from "@rollup/plugin-replace";
import nodePolyfills from "rollup-plugin-polyfill-node";
import terser from "@rollup/plugin-terser";
import serve from "rollup-plugin-serve";
export default {
input: "src/main.js",
output: {
sourcemap: false,
file: "build/HostIIIF.js",
format: "iife",
},
preserveEntrySignatures: "strict",
onwarn: function onwarn(warning, warn) {
if (warning.id.indexOf(__dirname + "/node_modules/") === 0) return;
warn(warning);
},
plugins: [
commonjs({
include: ["./node_modules/**"],
requireReturnsDefault: "auto",
}),
nodePolyfills(),
nodeResolve({
extensions: [".js"],
browser: true,
preferBuiltins: true,
}),
replace({
preventAssignment: true,
"process.env.NODE_ENV": JSON.stringify("development"),
}),
babel({
babelHelpers: "bundled",
presets: [
"@babel/preset-env",
["@babel/preset-react", { runtime: "automatic" }],
],
compact: false,
}),
terser(),
process.env.NODE_ENV !== "production" &&
serve({
verbose: true,
host: "192.168.1.74",
contentBase: "build",
port: 3000,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Expose-Headers": "*",
},
}),
],
};