forked from Agoric/realms-shim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
48 lines (43 loc) · 897 Bytes
/
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 minify from 'rollup-plugin-babel-minify';
import stripCode from 'rollup-plugin-strip-code';
export default () => {
const isProduction = process.env.NODE_ENV === 'production';
const minfix = isProduction ? '.min' : '';
const output = [
{
file: `dist/realms-shim.umd${minfix}.js`,
name: 'Realm',
format: 'umd',
sourcemap: true
},
{
file: `dist/realms-shim.esm${minfix}.js`,
format: 'esm',
sourcemap: true
}
];
const plugins = [
stripCode({
start_comment: 'START_TESTS_ONLY',
end_comment: 'END_TESTS_ONLY'
})
];
if (isProduction) {
plugins.push(
minify({
comments: false
})
);
} else {
output.push({
file: 'dist/realms-shim.cjs.js',
format: 'cjs',
sourcemap: true
});
}
return {
input: 'src/main.js',
output,
plugins
};
}