Skip to content

Commit b21631b

Browse files
committed
remove isAddOn option in favor of bundleType option
1 parent 5b0b4e2 commit b21631b

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

packages/browser/rollup.bundle.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const builds = [];
44

55
['es5', 'es6'].forEach(jsVersion => {
66
const baseBundleConfig = makeBaseBundleConfig({
7+
bundleType: 'standalone',
78
input: 'src/index.ts',
8-
isAddOn: false,
99
jsVersion,
1010
licenseTitle: '@sentry/browser',
1111
outputFileBase: `bundles/bundle${jsVersion === 'es5' ? '.es5' : ''}`,

packages/integrations/rollup.bundle.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const file = process.env.INTEGRATION_FILE;
88
const jsVersion = process.env.JS_VERSION;
99

1010
const baseBundleConfig = makeBaseBundleConfig({
11+
bundleType: 'addon',
1112
input: `src/${file}`,
12-
isAddOn: true,
1313
jsVersion,
1414
licenseTitle: '@sentry/integrations',
1515
outputFileBase: `bundles/${file.replace('.ts', '')}${jsVersion === 'ES5' ? '.es5' : ''}`,

packages/tracing/rollup.bundle.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const builds = [];
44

55
['es5', 'es6'].forEach(jsVersion => {
66
const baseBundleConfig = makeBaseBundleConfig({
7+
bundleType: 'standalone',
78
input: 'src/index.bundle.ts',
8-
isAddOn: false,
99
jsVersion,
1010
licenseTitle: '@sentry/tracing & @sentry/browser',
1111
outputFileBase: `bundles/bundle.tracing${jsVersion === 'es5' ? '.es5' : ''}`,

packages/vue/rollup.bundle.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { makeBaseBundleConfig, makeBundleConfigVariants } from '../../rollup/index.js';
22

33
const baseBundleConfig = makeBaseBundleConfig({
4+
bundleType: 'standalone',
45
input: 'src/index.bundle.ts',
5-
isAddOn: false,
66
jsVersion: 'es6',
77
licenseTitle: '@sentry/vue',
88
outputFileBase: 'bundle.vue',

packages/wasm/rollup.bundle.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { makeBaseBundleConfig, makeBundleConfigVariants } from '../../rollup/index.js';
22

33
const baseBundleConfig = makeBaseBundleConfig({
4+
bundleType: 'addon',
45
input: 'src/index.ts',
5-
isAddOn: true,
66
jsVersion: 'es6',
77
licenseTitle: '@sentry/wasm',
88
outputFileBase: 'bundles/wasm',

rollup/bundleHelpers.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { mergePlugins } from './utils';
1919

2020
export function makeBaseBundleConfig(options) {
21-
const { input, isAddOn, jsVersion, licenseTitle, outputFileBase } = options;
21+
const { bundleType, input, jsVersion, licenseTitle, outputFileBase } = options;
2222

2323
const nodeResolvePlugin = makeNodeResolvePlugin();
2424
const sucrasePlugin = makeSucrasePlugin();
@@ -93,7 +93,12 @@ export function makeBaseBundleConfig(options) {
9393
treeshake: 'smallest',
9494
};
9595

96-
return deepMerge(sharedBundleConfig, isAddOn ? addOnBundleConfig : standAloneBundleConfig, {
96+
const bundleTypeConfigMap = {
97+
standalone: standAloneBundleConfig,
98+
addon: addOnBundleConfig,
99+
};
100+
101+
return deepMerge(sharedBundleConfig, bundleTypeConfigMap[bundleType], {
97102
// Plugins have to be in the correct order or everything breaks, so when merging we have to manually re-order them
98103
customMerge: key => (key === 'plugins' ? mergePlugins : undefined),
99104
});

0 commit comments

Comments
 (0)