-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrollup.config.worker.js
65 lines (64 loc) · 1.44 KB
/
rollup.config.worker.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
import resolve from "@rollup/plugin-node-resolve";
import terser from "@rollup/plugin-terser";
import babel from "@rollup/plugin-babel";
/** @type {import('rollup').RollupOptions[]} */
export default [
{
input: `src/lib/worker.worker.ts`,
plugins: [
resolve(),
babel({
babelHelpers: "bundled",
include: ["src/**/*.ts"],
extensions: [".js", ".ts"],
exclude: ["./node_modules/**"],
presets: ["@babel/typescript"],
}),
],
output: [
{
file: ".temp/worker.esm.js",
format: "esm",
sourcemap: false,
name: "multithreading",
},
{
file: ".temp/worker.esm.min.js",
format: "esm",
sourcemap: false,
plugins: [
terser({
compress: {
toplevel: true,
passes: 3,
},
}),
],
name: "multithreading",
},
{
file: ".temp/worker.cjs.js",
format: "cjs",
sourcemap: false,
dynamicImportInCjs: true,
name: "multithreading",
},
{
file: ".temp/worker.cjs.min.js",
format: "cjs",
sourcemap: false,
dynamicImportInCjs: true,
plugins: [
terser({
compress: {
toplevel: true,
passes: 2,
},
mangle: {},
}),
],
name: "multithreading",
},
],
},
];