forked from rapyuta-robotics/amphion
-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.dev.js
44 lines (42 loc) · 1005 Bytes
/
rollup.config.dev.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
import commonjs from 'rollup-plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import replace from 'rollup-plugin-replace';
const isExternal = p => !!/^three/.test(p);
export default {
input: 'src/index.ts',
watch: {
chokidar: false,
},
onwarn(message) {
if (
// these two messages are false positives
// need to investigate why these are triggered
message.code === 'MISSING_GLOBAL_NAME' ||
message.code === 'UNRESOLVED_IMPORT'
) {
return;
}
console.warn(message);
},
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
typescript({ useTsconfigDeclarationDir: true }),
commonjs({ extensions: ['.js', '.ts'] }),
],
treeshake: true,
external: p => isExternal(p),
output: [
{
format: 'umd',
name: 'amphion',
file: 'build/amphion.js',
sourcemap: true,
},
{
format: 'es',
file: 'build/amphion.module.js',
},
],
};