forked from peggyjs/peggy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
76 lines (64 loc) · 1.5 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
71
72
73
74
75
76
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import multiEntry from "@rollup/plugin-multi-entry";
import nodeResolve from "@rollup/plugin-node-resolve";
const umd_config = {
onwarn(message) {
if (message.code === "EVAL") { return; }
console.error(message);
},
input: "build/ts/lib/peg.js",
output: {
file : "build/rollup/peggy.umd.js",
format : "umd",
name : "peggy",
},
plugins : [
nodeResolve({
mainFields : ["module", "main"],
browser : true,
extensions : [".js", ".json", ".ts", ".tsx"],
preferBuiltins : false,
}),
commonjs(),
],
};
const browser_test_config = {
onwarn(message) {
if (message.code === "EVAL") { return; }
console.error(message);
},
input: "build/ts/test/**/*.spec.js",
output: {
file : "build/rollup/test.umd.js",
format : "umd",
name : "browser",
globals: {
chai: "chai",
},
},
external: ["chai"],
plugins : [
json(),
nodeResolve(),
commonjs(),
multiEntry(),
],
};
const browser_benchmark_config = {
onwarn(message) {
if (message.code === "EVAL") { return; }
console.error(message);
},
input: "build/ts/benchmark/browser.stub.js",
output: {
file : "build/rollup/benchmark.umd.js",
format : "umd",
name : "browser",
},
plugins : [
nodeResolve(),
commonjs(),
],
};
export default [umd_config, browser_test_config, browser_benchmark_config];