-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.ci.config.js
More file actions
34 lines (30 loc) · 968 Bytes
/
rollup.ci.config.js
File metadata and controls
34 lines (30 loc) · 968 Bytes
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
import { plugins, VERSION } from './rollup.common.js';
import { terser } from 'rollup-plugin-terser';
export default env => {
const fileName = (outputSuffix) => `split-browser${env.branch !== 'main' ? `-dev-${env.commit_hash}` : `-${VERSION}`}${outputSuffix ? `.${outputSuffix}` : ''}`;
const createRollupConfig = (input, outputSuffix) => ({
input,
output: [
// development build
{
format: 'umd', // works as `cjs`, `iife` and `amd` all in one
name: 'splitio',
file: `umd/${fileName(outputSuffix)}.js`
},
// production build
{
format: 'umd',
name: 'splitio',
file: `umd/${fileName(outputSuffix)}.min.js`,
plugins: [
terser()
]
}
],
plugins
});
return [
createRollupConfig('src/full/umd.ts', 'full'), // umd/split-browser-VERSION.full[.min].js
createRollupConfig('src/umd.ts') // umd/split-browser-VERSION[.min].js
];
};