|
1 | 1 | import { makeBaseBundleConfig, makeLicensePlugin, terserPlugin } from '../../rollup.config';
|
2 | 2 |
|
| 3 | +const builds = []; |
| 4 | + |
3 | 5 | const licensePlugin = makeLicensePlugin('@sentry/tracing & @sentry/browser');
|
4 | 6 |
|
5 |
| -const baseBundleConfig = makeBaseBundleConfig({ |
6 |
| - input: 'src/index.bundle.ts', |
7 |
| - isAddOn: false, |
8 |
| - jsVersion: 'es5', |
9 |
| - outputFileBase: 'build/bundle.tracing', |
| 7 | +['es5', 'es6'].forEach(jsVersion => { |
| 8 | + const baseBundleConfig = makeBaseBundleConfig({ |
| 9 | + input: 'src/index.bundle.ts', |
| 10 | + isAddOn: false, |
| 11 | + jsVersion, |
| 12 | + outputFileBase: `build/bundle.tracing${jsVersion === 'es6' ? '.es6' : ''}`, |
| 13 | + }); |
| 14 | + |
| 15 | + builds.push( |
| 16 | + ...[ |
| 17 | + { |
| 18 | + ...baseBundleConfig, |
| 19 | + output: { |
| 20 | + ...baseBundleConfig.output, |
| 21 | + file: `${baseBundleConfig.output.file}.js`, |
| 22 | + }, |
| 23 | + plugins: [...baseBundleConfig.plugins, licensePlugin], |
| 24 | + }, |
| 25 | + { |
| 26 | + ...baseBundleConfig, |
| 27 | + output: { |
| 28 | + ...baseBundleConfig.output, |
| 29 | + file: `${baseBundleConfig.output.file}.min.js`, |
| 30 | + }, |
| 31 | + plugins: [...baseBundleConfig.plugins, terserPlugin, licensePlugin], |
| 32 | + }, |
| 33 | + ], |
| 34 | + ); |
10 | 35 | });
|
11 | 36 |
|
12 |
| -export default [ |
13 |
| - // ES5 Browser Tracing Bundle |
14 |
| - { |
15 |
| - ...baseBundleConfig, |
16 |
| - output: { |
17 |
| - ...baseBundleConfig.output, |
18 |
| - file: `${baseBundleConfig.output.file}.js`, |
19 |
| - }, |
20 |
| - plugins: [...baseBundleConfig.plugins, licensePlugin], |
21 |
| - }, |
22 |
| - { |
23 |
| - ...baseBundleConfig, |
24 |
| - output: { |
25 |
| - ...baseBundleConfig.output, |
26 |
| - file: `${baseBundleConfig.output.file}.min.js`, |
27 |
| - }, |
28 |
| - plugins: [...baseBundleConfig.plugins, terserPlugin, licensePlugin], |
29 |
| - }, |
30 |
| -]; |
| 37 | +export default builds; |
0 commit comments