1 | import replace from '@rollup/plugin-replace';
|
2 | import resolve from 'rollup-plugin-node-resolve';
|
3 | import babel from '@rollup/plugin-babel';
|
4 | import commonJS from 'rollup-plugin-commonjs';
|
5 | import { terser } from 'rollup-plugin-terser';
|
6 | import { version } from './package-lock.json';
|
7 |
|
8 | const production = process.env.NODE_ENV || 'production';
|
9 |
|
10 | export default [
|
11 | {
|
12 | input: 'src/module.js',
|
13 | output: [{ file: 'dist/daily-iframe-esm.js', format: 'es' }],
|
14 | plugins: [
|
15 | resolve({
|
16 | preferBuiltins: false,
|
17 | }),
|
18 | replace({
|
19 | 'process.env.NODE_ENV': JSON.stringify(production),
|
20 | __dailyJsVersion__: JSON.stringify(version),
|
21 | }),
|
22 | babel({
|
23 | exclude: 'node_modules/**',
|
24 | babelHelpers: 'runtime',
|
25 | presets: ['@babel/preset-env'],
|
26 | plugins: [
|
27 | '@babel/plugin-transform-runtime',
|
28 | '@babel/plugin-proposal-class-properties',
|
29 | ],
|
30 | }),
|
31 | commonJS({
|
32 | include: 'node_modules/**',
|
33 | namedExports: {
|
34 | 'node_modules/lodash/lodash.js': ['orderBy', 'filter'],
|
35 | },
|
36 | }),
|
37 | production && terser(),
|
38 | ],
|
39 | },
|
40 | ];
|