-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
50 lines (49 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
49
50
import resolve from 'rollup-plugin-node-resolve';
import commonJS from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import replace from 'rollup-plugin-replace';
export default {
input: 'index.js',
context: 'this',
plugins: [
// Hack to not add three.js twice to the final bundle as A-Frame provides it
replace({
'simbol': `import Simbol from './node_modules/simbol/build/simbol.nothree.js'`,
include: 'index.js',
delimiters: ['import Simbol from \'', '\'']
}),
replace({
[`readable-stream`]: `require('stream')`,
include: 'node_modules/simple-peer/index.js',
delimiters: ['require(\'', '\')']
}),
commonJS({
ignoreGlobal: true
}),
json(),
globals(),
builtins(),
resolve({
preferBuiltins: false,
browser: true
})
],
output: [
{
format: 'cjs',
sourcemap: true,
exports: 'named',
dir: 'build',
file: 'a-simbol.cjs.js'
},
{
format: 'es',
sourcemap: true,
exports: 'named',
dir: 'build',
file: 'a-simbol.js'
}
]
};