Skip to content

Commit 89b10f8

Browse files
committed
move es5 TS plugin to main config
1 parent 66c2d32 commit 89b10f8

File tree

6 files changed

+48
-69
lines changed

6 files changed

+48
-69
lines changed

packages/browser/rollup.config.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import { terser } from 'rollup-plugin-terser';
22
import typescript from 'rollup-plugin-typescript2';
33
import resolve from '@rollup/plugin-node-resolve';
44

5-
import { baseBundleConfig, makeLicensePlugin, markAsBrowserBuild, paths } from '../../rollup.config';
5+
import {
6+
baseBundleConfig,
7+
makeLicensePlugin,
8+
markAsBrowserBuild,
9+
paths,
10+
typescriptPluginES5,
11+
} from '../../rollup.config';
612

713
const licensePlugin = makeLicensePlugin();
814

@@ -36,18 +42,7 @@ const terserInstance = terser({
3642
});
3743

3844
const plugins = [
39-
typescript({
40-
tsconfig: 'tsconfig.esm.json',
41-
tsconfigOverride: {
42-
compilerOptions: {
43-
declaration: false,
44-
declarationMap: false,
45-
paths,
46-
baseUrl: '.',
47-
},
48-
},
49-
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
50-
}),
45+
typescriptPluginES5,
5146
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
5247
markAsBrowserBuild,
5348
resolve({

packages/integrations/rollup.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import * as fs from 'fs';
22

33
import { terser } from 'rollup-plugin-terser';
4-
import typescript from 'rollup-plugin-typescript2';
54
import resolve from '@rollup/plugin-node-resolve';
65
import commonjs from '@rollup/plugin-commonjs';
76

8-
import { addOnBundleConfig, baseBundleConfig, markAsBrowserBuild, paths } from '../../rollup.config';
7+
import { addOnBundleConfig, baseBundleConfig, markAsBrowserBuild, typescriptPluginES5 } from '../../rollup.config';
98

109
const terserInstance = terser({
1110
mangle: {
@@ -22,18 +21,7 @@ const terserInstance = terser({
2221
});
2322

2423
const plugins = [
25-
typescript({
26-
tsconfig: 'tsconfig.esm.json',
27-
tsconfigOverride: {
28-
compilerOptions: {
29-
declaration: false,
30-
declarationMap: false,
31-
paths,
32-
baseUrl: '.',
33-
},
34-
},
35-
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
36-
}),
24+
typescriptPluginES5,
3725
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
3826
markAsBrowserBuild,
3927
resolve({

packages/tracing/rollup.config.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
import typescript from 'rollup-plugin-typescript2';
21
import resolve from '@rollup/plugin-node-resolve';
32

4-
import { baseBundleConfig, makeLicensePlugin, markAsBrowserBuild, paths, terserPlugin } from '../../rollup.config';
3+
import {
4+
baseBundleConfig,
5+
makeLicensePlugin,
6+
markAsBrowserBuild,
7+
terserPlugin,
8+
typescriptPluginES5,
9+
} from '../../rollup.config';
510

611
const licensePlugin = makeLicensePlugin('@sentry/tracing & @sentry/browser');
712

813
const plugins = [
9-
typescript({
10-
tsconfig: 'tsconfig.esm.json',
11-
tsconfigOverride: {
12-
compilerOptions: {
13-
declaration: false,
14-
declarationMap: false,
15-
paths,
16-
baseUrl: '.',
17-
},
18-
},
19-
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
20-
}),
14+
typescriptPluginES5,
2115
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
2216
markAsBrowserBuild,
2317
resolve({

packages/vue/rollup.config.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
import typescript from 'rollup-plugin-typescript2';
21
import resolve from '@rollup/plugin-node-resolve';
32

4-
import { baseBundleConfig, makeLicensePlugin, markAsBrowserBuild, paths, terserPlugin } from '../../rollup.config';
3+
import {
4+
baseBundleConfig,
5+
makeLicensePlugin,
6+
markAsBrowserBuild,
7+
terserPlugin,
8+
typescriptPluginES5,
9+
} from '../../rollup.config';
510

611
const licensePlugin = makeLicensePlugin();
712

813
const plugins = [
9-
typescript({
10-
tsconfig: 'tsconfig.esm.json',
11-
tsconfigOverride: {
12-
compilerOptions: {
13-
declaration: false,
14-
declarationMap: false,
15-
paths,
16-
baseUrl: '.',
17-
},
18-
},
19-
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
20-
}),
14+
typescriptPluginES5,
2115
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
2216
markAsBrowserBuild,
2317
resolve({

packages/wasm/rollup.config.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
import typescript from 'rollup-plugin-typescript2';
21
import resolve from '@rollup/plugin-node-resolve';
32

4-
import { addOnBundleConfig, baseBundleConfig, paths, markAsBrowserBuild, terserPlugin } from '../../rollup.config';
3+
import {
4+
addOnBundleConfig,
5+
baseBundleConfig,
6+
markAsBrowserBuild,
7+
terserPlugin,
8+
typescriptPluginES5,
9+
} from '../../rollup.config';
510

611
const plugins = [
7-
typescript({
8-
tsconfig: 'tsconfig.esm.json',
9-
tsconfigOverride: {
10-
compilerOptions: {
11-
declaration: false,
12-
declarationMap: false,
13-
paths,
14-
baseUrl: '.',
15-
},
16-
},
17-
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
18-
}),
12+
typescriptPluginES5,
1913
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
2014
markAsBrowserBuild,
2115
resolve({

rollup.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import license from 'rollup-plugin-license';
66
import replace from '@rollup/plugin-replace';
77
import { terser } from 'rollup-plugin-terser';
8+
import typescript from 'rollup-plugin-typescript2';
89

910
export const paths = {
1011
'@sentry/browser': ['../browser/src'],
@@ -59,6 +60,19 @@ export const markAsBrowserBuild = replace({
5960
},
6061
});
6162

63+
export const typescriptPluginES5 = typescript({
64+
tsconfig: 'tsconfig.esm.json',
65+
tsconfigOverride: {
66+
compilerOptions: {
67+
declaration: false,
68+
declarationMap: false,
69+
paths,
70+
baseUrl: '.',
71+
},
72+
},
73+
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
74+
});
75+
6276
export const baseBundleConfig = {
6377
output: {
6478
sourcemap: true,

0 commit comments

Comments
 (0)