Skip to content

Commit fd807db

Browse files
scttcperandrewshie-sentry
authored andcommitted
build(ui): Use rspack to build production (#92493)
will remove webpack soon. reorders the commands a little bit
1 parent 1ee2c19 commit fd807db

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"@emotion/is-prop-valid": "^1.3.0",
2525
"@emotion/react": "^11.14.0",
2626
"@emotion/styled": "^11.14.0",
27+
"@mdx-js/loader": "^3.1.0",
28+
"@mdx-js/mdx": "^3.1.0",
29+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.16",
2730
"@popperjs/core": "^2.11.5",
2831
"@react-aria/button": "^3.9.8",
2932
"@react-aria/combobox": "^3.10.3",
@@ -74,6 +77,7 @@
7477
"@sentry/status-page-list": "^0.6.0",
7578
"@sentry/webpack-plugin": "^3.4.0",
7679
"@spotlightjs/spotlight": "^2.0.0-alpha.1",
80+
"@swc/plugin-emotion": "9.0.4",
7781
"@tanstack/query-async-storage-persister": "^5.72.1",
7882
"@tanstack/react-query": "^5.72.1",
7983
"@tanstack/react-query-devtools": "^5.72.1",
@@ -84,7 +88,7 @@
8488
"@types/gtag.js": "^0.0.12",
8589
"@types/history": "^3.2.5",
8690
"@types/invariant": "^2.2.35",
87-
"@types/jest": "29.5.12",
91+
"@types/jest": "29.5.14",
8892
"@types/js-beautify": "^1.14.3",
8993
"@types/js-cookie": "^3.0.2",
9094
"@types/lodash": "^4.14.182",
@@ -130,6 +134,7 @@
130134
"fuse.js": "^6.6.2",
131135
"gettext-parser": "7.0.1",
132136
"gl-matrix": "^3.4.3",
137+
"html-webpack-plugin": "5.6.3",
133138
"idb-keyval": "^6.2.1",
134139
"invariant": "^2.2.4",
135140
"jed": "^1.1.0",
@@ -192,14 +197,10 @@
192197
"@eslint/compat": "^1.2.7",
193198
"@eslint/eslintrc": "^3.3.0",
194199
"@eslint/js": "^9.22.0",
195-
"@mdx-js/loader": "^3.1.0",
196-
"@mdx-js/mdx": "^3.1.0",
197-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.16",
198200
"@sentry-internal/rrweb-types": "2.34.0",
199201
"@sentry/jest-environment": "6.0.0",
200202
"@sentry/profiling-node": "9.16.1",
201203
"@styled/typescript-styled-plugin": "^1.0.1",
202-
"@swc/plugin-emotion": "9.0.4",
203204
"@tanstack/eslint-plugin-query": "^5.66.1",
204205
"@testing-library/dom": "10.4.0",
205206
"@testing-library/jest-dom": "6.6.3",
@@ -225,7 +226,6 @@
225226
"eslint-plugin-typescript-sort-keys": "^3.3.0",
226227
"eslint-plugin-unicorn": "^57.0.0",
227228
"globals": "^15.14.0",
228-
"html-webpack-plugin": "5.6.3",
229229
"jest": "29.7.0",
230230
"jest-canvas-mock": "^2.5.2",
231231
"jest-environment-jsdom": "29.7.0",
@@ -279,10 +279,11 @@
279279
"diff-docs": "yarn install-api-docs && ts-node api-docs/openapi-diff.ts",
280280
"deref-api-docs": "ts-node api-docs/index.ts tests/apidocs/openapi-spectacular.json tests/apidocs/openapi-derefed.json",
281281
"build-chartcuterie-config": "node --experimental-strip-types config/build-chartcuterie.ts",
282-
"build-acceptance-rspack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production rspack",
283-
"build-acceptance-webpack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production webpack",
284282
"build-acceptance": "yarn build-acceptance-rspack",
285-
"build-production": "NODE_ENV=production webpack --mode production",
283+
"build-acceptance-webpack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production webpack",
284+
"build-acceptance-rspack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production rspack",
285+
"build-production": "yarn build-production-rspack",
286+
"build-production-webpack": "NODE_ENV=production webpack --mode production",
286287
"build-production-rspack": "NODE_ENV=production rspack --mode production",
287288
"build": "NODE_OPTIONS=--max-old-space-size=4096 webpack",
288289
"build-rspack": "NODE_OPTIONS=--max-old-space-size=4096 rspack",

rspack.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ const swcReactLoaderConfig: RuleSetRule['options'] = {
203203
const appConfig: Configuration = {
204204
mode: WEBPACK_MODE,
205205
target: 'browserslist',
206+
// Fail on first error instead of continuing to build
207+
// https://rspack.rs/config/other-options#bail
208+
bail: IS_PRODUCTION,
206209
entry: {
207210
/**
208211
* Main Sentry SPA

src/sentry/build/_static_assets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def _cmd(*cmd: str) -> None:
2424

2525
_cmd("yarn", "install", "--production", "--frozen-lockfile", "--quiet")
2626
_cmd("yarn", "tsc", "-p", "config/tsconfig.build.json")
27-
_cmd("yarn", "build-production", "--bail")
28-
_cmd("yarn", "build-chartcuterie-config", "--bail")
27+
_cmd("yarn", "build-production")
28+
_cmd("yarn", "build-chartcuterie-config")
2929

3030

3131
def main() -> int:

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4374,10 +4374,10 @@
43744374
dependencies:
43754375
"@types/istanbul-lib-report" "*"
43764376

4377-
"@types/jest@29.5.12":
4378-
version "29.5.12"
4379-
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.12.tgz#7f7dc6eb4cf246d2474ed78744b05d06ce025544"
4380-
integrity sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==
4377+
"@types/jest@29.5.14":
4378+
version "29.5.14"
4379+
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5"
4380+
integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==
43814381
dependencies:
43824382
expect "^29.0.0"
43834383
pretty-format "^29.0.0"

0 commit comments

Comments
 (0)