Skip to content

Commit

Permalink
CONSOLE-3905: use esbuild-loader instead of ts-loader
Browse files Browse the repository at this point in the history
Improves build speed by 50% (267s vs 142s)
  • Loading branch information
logonoff committed Dec 5, 2024
1 parent 3ef0438 commit f84c21c
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 35 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"cypress-jest-adapter": "^0.1.1",
"cypress-multi-reporters": "^1.4.0",
"enzyme": "3.10.x",
"esbuild-loader": "^4.2.2",
"file-loader": "6.2.0",
"find-up": "4.x",
"fork-ts-checker-webpack-plugin": "9.0.2",
Expand Down Expand Up @@ -320,7 +321,6 @@
"style-loader": "^2.0.0",
"thread-loader": "^4.0.4",
"ts-jest": "21.x",
"ts-loader": "^9.5.1",
"ts-node": "10.9.2",
"typescript": "4.5.5",
"umd-compat-loader": "^2.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ module.exports = (on, config) => {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true,
},
loader: 'esbuild-loader',
},
{
test: /\.feature$/,
Expand Down
3 changes: 1 addition & 2 deletions frontend/packages/integration-tests-cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports = (on, config) => {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: { happyPackMode: true, transpileOnly: true },
loader: 'esbuild-loader',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ module.exports = (on, config) => {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true,
},
loader: 'esbuild-loader',
},
{
test: /\.feature$/,
Expand Down
6 changes: 2 additions & 4 deletions frontend/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,10 @@ const config: Configuration = {
]
: []),
{
loader: 'ts-loader',
loader: 'esbuild-loader',
options: {
// Always use the root tsconfig.json. Packages might have a separate tsconfig.json for storybook.
configFile: path.resolve(__dirname, 'tsconfig.json'),
happyPackMode: true, // This implicitly enables transpileOnly! No type checking!
transpileOnly: true, // fork-ts-checker-webpack-plugin takes care of type checking
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
},
},
],
Expand Down
Loading

0 comments on commit f84c21c

Please sign in to comment.