Skip to content

Commit a3738b7

Browse files
gaterkingkamilogorek
authored andcommitted
build: Change browser build to include tslib once in a whole bundle (#1738)
* ref: change browser workspace building. Use typescript code in another packages instead of js in dist. It can reduce the bundle size by use tslib be shared.
1 parent 67e2215 commit a3738b7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/browser/rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const bundleConfig = {
2020
typescript({
2121
tsconfig: 'tsconfig.build.json',
2222
tsconfigOverride: { compilerOptions: { declaration: false } },
23+
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
2324
}),
2425
resolve({
2526
jsnext: true,
@@ -44,10 +45,11 @@ export default [
4445
interop: false,
4546
sourcemap: true,
4647
},
47-
external: ['@sentry/core', '@sentry/hub', '@sentry/minimal'],
48+
external: ['@sentry/core', '@sentry/hub', '@sentry/minimal', 'tslib'],
4849
plugins: [
4950
typescript({
5051
tsconfig: 'tsconfig.build.json',
52+
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
5153
}),
5254
resolve({
5355
jsnext: true,

packages/browser/tsconfig.build.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
"compilerOptions": {
44
"baseUrl": ".",
55
"outDir": "dist",
6-
"rootDir": "src"
6+
"paths": {
7+
"@sentry/utils/*": ["../utils/src/*"],
8+
"@sentry/core": ["../core/src"],
9+
"@sentry/hub": ["../hub/src"],
10+
"@sentry/types": ["../types/src"],
11+
"@sentry/minimal": ["../minimal/src"]
12+
}
713
},
814
"include": ["src/**/*"]
915
}

0 commit comments

Comments
 (0)