Skip to content

Commit

Permalink
feat: add esbuild loader
Browse files Browse the repository at this point in the history
  • Loading branch information
memoyil committed Jan 8, 2025
1 parent 2b6b184 commit 1d1092f
Show file tree
Hide file tree
Showing 3 changed files with 318 additions and 119 deletions.
15 changes: 15 additions & 0 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,21 @@ const config = {
]
},
webpack: (webpackConfig, { webpack, isServer }) => {
webpackConfig.module.rules = webpackConfig.module.rules.map((rule) => {
if (rule.test?.toString().includes('tsx|ts|js|mjs|jsx')) {
return {
...rule,
use: {
loader: 'esbuild-loader',
options: {
loader: 'tsx',
target: 'es2020',
},
},
};
}
return rule;
});
// tree shake sentry tracing
webpackConfig.plugins.push(
new webpack.DefinePlugin({
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
"eslint": "^8.32.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-lodash": "^7.4.0",
"esbuild-loader": "4.2.2",
"happy-dom": "^13.3.8",
"lint-staged": "^12.3.4",
"openapi-typescript": "7.0.0-rc.0",
Expand Down
Loading

0 comments on commit 1d1092f

Please sign in to comment.