Skip to content

Commit

Permalink
Workaround antd v3 error in the production build (#1276)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Unbreak the UI in the production build (closes #1275)
## Short description of the changes
It seems that the antd v3 upgrade in
cda1746 causes an error in the
production build, apparently due to a bad interplay with vite/esbuild
bundling. As a workaround, provide an import alias for the antd icon
sprite file that's causing the issue.[1]

---
[1]
ant-design/ant-design#19002 (comment)

Signed-off-by: Máté Szabó <[email protected]>
  • Loading branch information
mszabo-wikia authored Mar 15, 2023
1 parent 543de7a commit 06cc66c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/jaeger-ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export default defineConfig({
__REACT_APP_VSN_STATE__: JSON.stringify(process.env.REACT_APP_VSN_STATE || ''),
__APP_ENVIRONMENT__: JSON.stringify(process.env.NODE_ENV || 'development'),
},
// Workaround an imports issue with antd v3 that causes an error in the production build.
// https://github.com/ant-design/ant-design/issues/19002
resolve: {
alias: {
'@ant-design/icons/lib/dist': '@ant-design/icons/lib/index.es.js',
},
},
plugins: [
react(),
legacy({
Expand Down

0 comments on commit 06cc66c

Please sign in to comment.