tsx - Babel loader in webpack.config.js #999

Closed
opened 2025-08-09 17:18:29 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @martinnov92 on 2/21/2017

Hello, I was having issues with this { test: /\.ts(x?)$/, include: /ClientApp/, use: 'babel-loader' }, in your webpack.config.js (It used to display errors when building minif. production files.).
I change it to { test: /\.js(x?)$/, include: /ClientApp/, use: 'babel-loader' }, and now it's working properly.

Shouldn't it be .js(x?)$: { test: /\.js(x?)$/, include: /ClientApp/, use: 'babel-loader' }, when we are using babel-loader instead of tsx?
Hope it makes sense.
Thank you

*Originally created by @martinnov92 on 2/21/2017* Hello, I was having issues with this `{ test: /\.ts(x?)$/, include: /ClientApp/, use: 'babel-loader' },` in your webpack.config.js (It used to display errors when building minif. production files.). I change it to `{ test: /\.js(x?)$/, include: /ClientApp/, use: 'babel-loader' },` and now it's working properly. Shouldn't it be **.js(x?)$**: `{ test: /\.js(x?)$/, include: /ClientApp/, use: 'babel-loader' },` when we are using babel-loader instead of tsx? Hope it makes sense. Thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#999
No description provided.