Skip to content

Commit 65c44ec

Browse files
authored
perf(build): Use @rollup/plugin-typescript for es5 builds (#7665)
1 parent 1eb271a commit 65c44ec

File tree

3 files changed

+18
-103
lines changed

3 files changed

+18
-103
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
"rollup-plugin-cleanup": "3.2.1",
111111
"rollup-plugin-license": "^2.6.1",
112112
"rollup-plugin-terser": "^7.0.2",
113-
"rollup-plugin-typescript2": "^0.31.2",
114113
"sinon": "^7.3.2",
115114
"size-limit": "^4.5.5",
116115
"ts-jest": "^27.1.4",

rollup/plugins/bundlePlugins.js

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Resolve plugin docs: https://github.com/rollup/plugins/tree/master/packages/node-resolve
66
* Terser plugin docs: https://github.com/TrySound/rollup-plugin-terser#options
77
* Terser docs: https://github.com/terser/terser#api-reference
8-
* Typescript plugin docs: https://github.com/ezolenko/rollup-plugin-typescript2
8+
* Typescript plugin docs: https://github.com/rollup/plugins/tree/master/packages/typescript/#readme
99
*/
1010

1111
import * as fs from 'fs';
@@ -17,7 +17,7 @@ import license from 'rollup-plugin-license';
1717
import resolve from '@rollup/plugin-node-resolve';
1818
import replace from '@rollup/plugin-replace';
1919
import { terser } from 'rollup-plugin-terser';
20-
import typescript from 'rollup-plugin-typescript2';
20+
import typescript from '@rollup/plugin-typescript';
2121

2222
/**
2323
* Create a plugin to add an identification banner to the top of stand-alone bundles.
@@ -145,38 +145,27 @@ export function makeTerserPlugin() {
145145
export function makeTSPlugin(jsVersion) {
146146
const baseTSPluginOptions = {
147147
tsconfig: 'tsconfig.json',
148-
tsconfigOverride: {
149-
compilerOptions: {
150-
declaration: false,
151-
declarationMap: false,
152-
paths: {
153-
'@sentry/browser': ['../browser/src'],
154-
'@sentry/core': ['../core/src'],
155-
'@sentry/hub': ['../hub/src'],
156-
'@sentry/types': ['../types/src'],
157-
'@sentry/utils': ['../utils/src'],
158-
'@sentry-internal/integration-shims': ['../integration-shims/src'],
159-
'@sentry-internal/tracing': ['../tracing-internal/src'],
160-
},
161-
baseUrl: '.',
148+
compilerOptions: {
149+
declaration: false,
150+
declarationMap: false,
151+
paths: {
152+
'@sentry/browser': ['../browser/src'],
153+
'@sentry/core': ['../core/src'],
154+
'@sentry/hub': ['../hub/src'],
155+
'@sentry/types': ['../types/src'],
156+
'@sentry/utils': ['../utils/src'],
157+
'@sentry-internal/integration-shims': ['../integration-shims/src'],
158+
'@sentry-internal/tracing': ['../tracing-internal/src'],
162159
},
160+
baseUrl: '.',
163161
},
164162
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
165-
// the typescript plugin doesn't handle concurrency very well, so clean the cache between builds
166-
// (see https://github.com/ezolenko/rollup-plugin-typescript2/issues/15)
167-
clean: true,
168-
// TODO: For the moment, the above issue seems to have stopped spamming the build with (non-blocking) errors, as it
169-
// was originally. If it starts again, this will suppress that output. If we get to the end of the bundle revamp and
170-
// it still seems okay, we can take this out entirely.
171-
// verbosity: 0,
172163
};
173164

174165
const plugin = typescript(
175166
deepMerge(baseTSPluginOptions, {
176-
tsconfigOverride: {
177-
compilerOptions: {
178-
target: jsVersion,
179-
},
167+
compilerOptions: {
168+
target: jsVersion,
180169
},
181170
}),
182171
);

yarn.lock

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3992,7 +3992,7 @@
39923992
estree-walker "^1.0.1"
39933993
picomatch "^2.2.2"
39943994

3995-
"@rollup/pluginutils@^4.1.1", "@rollup/pluginutils@^4.1.2":
3995+
"@rollup/pluginutils@^4.1.1":
39963996
version "4.2.1"
39973997
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d"
39983998
integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==
@@ -4308,14 +4308,6 @@
43084308
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
43094309
integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==
43104310

4311-
"@ts-type/package-dts@^1.0.58":
4312-
version "1.0.58"
4313-
resolved "https://registry.yarnpkg.com/@ts-type/package-dts/-/package-dts-1.0.58.tgz#75f6fdf5f1e8f262a5081b90346439b4c4bc8d01"
4314-
integrity sha512-Ry5RPZDAnSz/gyLtjd2a2yNC07CZ/PCOsuDzYj3phOolIgEH68HXRw6SbsDlavnVUEenDYj5GUM10gQ5iVEbVQ==
4315-
dependencies:
4316-
"@types/semver" "^7.3.9"
4317-
ts-type "^2.1.4"
4318-
43194311
"@tsconfig/node10@^1.0.7":
43204312
version "1.0.8"
43214313
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
@@ -5054,7 +5046,7 @@
50545046
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275"
50555047
integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==
50565048

5057-
"@types/semver@^7.3.12", "@types/semver@^7.3.9":
5049+
"@types/semver@^7.3.12":
50585050
version "7.3.13"
50595051
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91"
50605052
integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==
@@ -5740,16 +5732,6 @@
57405732
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
57415733
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
57425734

5743-
"@yarn-tool/resolve-package@^1.0.40":
5744-
version "1.0.42"
5745-
resolved "https://registry.yarnpkg.com/@yarn-tool/resolve-package/-/resolve-package-1.0.42.tgz#4a72c1a77b7035dc86250744d2cdbc16292bc4f8"
5746-
integrity sha512-1BAsoiD6jGAaPc7mRH0UxIVXgRSTv7fnhwfKkaFUYpqsU4ZR7KIigZTMcb2bujtlzKQbNneMPQGjiqe3F8cmlw==
5747-
dependencies:
5748-
"@ts-type/package-dts" "^1.0.58"
5749-
pkg-dir "< 6 >= 5"
5750-
tslib "^2.3.1"
5751-
upath2 "^3.1.12"
5752-
57535735
"@yarnpkg/[email protected]", "@yarnpkg/lockfile@^1.1.0":
57545736
version "1.1.0"
57555737
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
@@ -20635,13 +20617,6 @@ path-is-inside@^1.0.2:
2063520617
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
2063620618
integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=
2063720619

20638-
path-is-network-drive@^1.0.13:
20639-
version "1.0.13"
20640-
resolved "https://registry.yarnpkg.com/path-is-network-drive/-/path-is-network-drive-1.0.13.tgz#c9aa0183eb72c328aa83f43def93ddcb9d7ec4d4"
20641-
integrity sha512-Hg74mRN6mmXV+gTm3INjFK40ncAmC/Lo4qoQaSZ+GT3hZzlKdWQSqAjqyPeW0SvObP2W073WyYEBWY9d3wOm3A==
20642-
dependencies:
20643-
tslib "^2.3.1"
20644-
2064520620
path-key@^2.0.0, path-key@^2.0.1:
2064620621
version "2.0.1"
2064720622
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
@@ -20674,13 +20649,6 @@ path-root@^0.1.1:
2067420649
dependencies:
2067520650
path-root-regex "^0.1.0"
2067620651

20677-
path-strip-sep@^1.0.10:
20678-
version "1.0.10"
20679-
resolved "https://registry.yarnpkg.com/path-strip-sep/-/path-strip-sep-1.0.10.tgz#2be4e789406b298af8709ff79af716134b733b98"
20680-
integrity sha512-JpCy+8LAJQQTO1bQsb/84s1g+/Stm3h39aOpPRBQ/paMUGVPPZChLTOTKHoaCkc/6sKuF7yVsnq5Pe1S6xQGcA==
20681-
dependencies:
20682-
tslib "^2.3.1"
20683-
2068420652
2068520653
version "0.1.7"
2068620654
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
@@ -20883,13 +20851,6 @@ [email protected]:
2088320851
optionalDependencies:
2088420852
nice-napi "^1.0.2"
2088520853

20886-
"pkg-dir@< 6 >= 5":
20887-
version "5.0.0"
20888-
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760"
20889-
integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==
20890-
dependencies:
20891-
find-up "^5.0.0"
20892-
2089320854
pkg-dir@^2.0.0:
2089420855
version "2.0.0"
2089520856
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b"
@@ -23537,18 +23498,6 @@ rollup-plugin-terser@^7.0.2:
2353723498
serialize-javascript "^4.0.0"
2353823499
terser "^5.0.0"
2353923500

23540-
rollup-plugin-typescript2@^0.31.2:
23541-
version "0.31.2"
23542-
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.31.2.tgz#463aa713a7e2bf85b92860094b9f7fb274c5a4d8"
23543-
integrity sha512-hRwEYR1C8xDGVVMFJQdEVnNAeWRvpaY97g5mp3IeLnzhNXzSVq78Ye/BJ9PAaUfN4DXa/uDnqerifMOaMFY54Q==
23544-
dependencies:
23545-
"@rollup/pluginutils" "^4.1.2"
23546-
"@yarn-tool/resolve-package" "^1.0.40"
23547-
find-cache-dir "^3.3.2"
23548-
fs-extra "^10.0.0"
23549-
resolve "^1.20.0"
23550-
tslib "^2.3.1"
23551-
2355223501
rollup-pluginutils@^2.8.2:
2355323502
version "2.8.2"
2355423503
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
@@ -26136,14 +26085,6 @@ ts-pnp@^1.1.6:
2613626085
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
2613726086
integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==
2613826087

26139-
ts-type@^2.1.4:
26140-
version "2.1.4"
26141-
resolved "https://registry.yarnpkg.com/ts-type/-/ts-type-2.1.4.tgz#d268d52ac054ef3076bf1c3b2fde0d4d5496e6a3"
26142-
integrity sha512-wnajiiIMhn/RHJ1oPld95siKmMJrOgaT6+rMmC8vO1LORgDFEzKP2nBmEFM5b4XVe7Q0J5KcU9oRJFzju7UzrA==
26143-
dependencies:
26144-
tslib "^2.3.1"
26145-
typedarray-dts "^1.0.0"
26146-
2614726088
tsconfig-paths@^3.9.0:
2614826089
version "3.9.0"
2614926090
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b"
@@ -26294,11 +26235,6 @@ type@^2.5.0:
2629426235
resolved "https://registry.yarnpkg.com/type/-/type-2.6.0.tgz#3ca6099af5981d36ca86b78442973694278a219f"
2629526236
integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==
2629626237

26297-
typedarray-dts@^1.0.0:
26298-
version "1.0.0"
26299-
resolved "https://registry.yarnpkg.com/typedarray-dts/-/typedarray-dts-1.0.0.tgz#9dec9811386dbfba964c295c2606cf9a6b982d06"
26300-
integrity sha512-Ka0DBegjuV9IPYFT1h0Qqk5U4pccebNIJCGl8C5uU7xtOs+jpJvKGAY4fHGK25hTmXZOEUl9Cnsg5cS6K/b5DA==
26301-
2630226238
typedarray-to-buffer@^3.1.5:
2630326239
version "3.1.5"
2630426240
resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080"
@@ -26587,15 +26523,6 @@ untildify@^2.1.0:
2658726523
dependencies:
2658826524
os-homedir "^1.0.0"
2658926525

26590-
upath2@^3.1.12:
26591-
version "3.1.12"
26592-
resolved "https://registry.yarnpkg.com/upath2/-/upath2-3.1.12.tgz#441b3dfbadde21731017bd1b7beb169498efd0a9"
26593-
integrity sha512-yC3eZeCyCXFWjy7Nu4pgjLhXNYjuzuUmJiRgSSw6TJp8Emc+E4951HGPJf+bldFC5SL7oBLeNbtm1fGzXn2gxw==
26594-
dependencies:
26595-
path-is-network-drive "^1.0.13"
26596-
path-strip-sep "^1.0.10"
26597-
tslib "^2.3.1"
26598-
2659926526
upath@^1.1.1:
2660026527
version "1.2.0"
2660126528
resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894"

0 commit comments

Comments
 (0)