1 | import { visualizer } from 'rollup-plugin-visualizer';
|
2 | const isBundleVis = !!process.env.BUNDLE_VIS;
|
3 |
|
4 | export default process.env.CI && process.env.CI === 'true'
|
5 | ? {}
|
6 | : {
|
7 | umd: {
|
8 | name: 'F2',
|
9 | file: 'index',
|
10 | minFile: true,
|
11 | },
|
12 |
|
13 | entry: ['src/index.ts'],
|
14 | overridesByEntry: {
|
15 | 'src/index.ts': {
|
16 | umd: { name: 'F2', file: 'index' },
|
17 | },
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | },
|
23 |
|
24 | typescriptOpts: {
|
25 | tsconfigOverride: {
|
26 | compilerOptions: {
|
27 | target: 'es5',
|
28 | },
|
29 | },
|
30 | },
|
31 | extraBabelPlugins: [[
|
32 | "search-and-replace",
|
33 | {
|
34 | "rules": [
|
35 | {
|
36 | "search": "VERSION",
|
37 | "searchTemplateStrings": true,
|
38 | "replace": JSON.stringify(require('./package').version)
|
39 | }
|
40 | ]
|
41 | }
|
42 | ]],
|
43 | extraRollupPlugins: [...(isBundleVis ? [visualizer()] : [])],
|
44 | };
|