-
Notifications
You must be signed in to change notification settings - Fork 11
/
rollup.config.js
48 lines (47 loc) · 1.1 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
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs";
// import { terser } from "rollup-plugin-terser";
import analyze from 'rollup-plugin-analyzer';
import alias from '@rollup/plugin-alias';
// import del from 'rollup-plugin-delete'
// import serve from 'rollup-plugin-serve';
import comlink from "@surma/rollup-plugin-comlink";
import OMT from "@surma/rollup-plugin-off-main-thread";
export default {
input: "src/handy-work.js",
preserveEntrySignatures: 'false',
output: {
dir: "build/esm/",
format: "esm",
sourcemap: true,
manualChunks: {
'shared': ['three/src/Three.js', 'comlink', './src/normalize.js']
},
chunkFileNames: '[name].js'
},
plugins: [
alias({
entries: [
{ find: /^three$/, replacement: 'three/src/Three.js' }
]
}),
comlink({
useModuleWorker: true
}),
OMT({}),
resolve(),
commonjs({
include: ["node_modules/**"],
}),
// terser(),
analyze(),
// serve({
// open: true,
// host: 'localhost',
// port: 9001,
// mimeTypes: {
// 'application/javascript': ['js_commonjs-proxy']
// }
// })
]
};