-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
54 lines (52 loc) · 1.27 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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const alias = require("@rollup/plugin-alias");
const commonjs = require("@rollup/plugin-commonjs");
const resolve = require("@rollup/plugin-node-resolve");
const replace = require("@rollup/plugin-replace");
const typescript = require("@rollup/plugin-typescript");
const copy = require("rollup-plugin-copy");
const nodeBuiltins = require("rollup-plugin-node-builtins");
module.exports = {
input: "src/index.ts",
output: {
file: "dist/graphica.js",
format: "umd",
name: "Graphica",
sourcemap: true,
globals: {
'typeof self !== "undefined" ? self : this': "this",
},
},
plugins: [
typescript(),
resolve({
preferBuiltins: false,
}),
commonjs(),
replace({
"process.env.NODE_ENV": JSON.stringify("production"),
preventAssignment: true,
}),
nodeBuiltins(),
copy({
targets: [
{
src: "node_modules/three/examples/jsm/**/*",
dest: "dist/jsm",
},
],
}),
alias({
entries: [
{
find: "three/examples/jsm",
replacement: path.resolve(
__dirname,
"node_modules/three/examples/jsm"
),
},
],
}),
],
};