-
Notifications
You must be signed in to change notification settings - Fork 28
/
rollup.config.js
43 lines (40 loc) · 1.2 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
// Rollup plugins
import { babel } from '@rollup/plugin-babel';
import eslint from '@rollup/plugin-eslint';
import replace from '@rollup/plugin-replace';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
const pkg = require('./package.json');
export default {
input: 'src/export.js',
output: [
{
file: 'demo/ZLMRTCClient.js',
format: 'iife',
name: 'ZLMRTCClient',
sourcemap: true // 'inline'
}
],
plugins: [
replace({
exclude: 'node_modules/**',
include:['src/ulity/version.js'],
preventAssignment:true,
ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
values:{
__BUILD_DATE__: () => (new Date()).toString(),
__VERSION__:pkg.version
}
}),
eslint(),
nodeResolve({
browser: true,
}),
commonjs(),
babel({
exclude: 'node_modules/**',
babelHelpers: 'bundled'
}),
(process.env.NODE_ENV === 'production'),
],
};