Skip to content

Commit 37abf44

Browse files
committed
Fix test regex for react compiler loader in both webpack, babel config
1 parent 52857d7 commit 37abf44

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = function (api) {
1313
overrides: [
1414
{
1515
test: new RegExp(
16-
`^${path.join(__dirname, 'ui')}${slash}(?:components|contexts|hooks|layouts|pages)${slash}(?:.(?!\\.(?:test|stories|container)))+\\.(?:m?[jt]s|[jt]sx)$`,
16+
`^${path.join(__dirname, 'ui')}${slash}(?:components|contexts|hooks|layouts|pages)${slash}^(?!.*\\.(?:test|stories|container)\\.)(?:.*)\\.(?:m?[jt]s|[jt]sx)$$`,
1717
'u',
1818
),
1919
plugins: [['babel-plugin-react-compiler', { target: '17' }]],

development/webpack/webpack.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ const config = {
335335
type: 'asset/resource',
336336
},
337337
{
338-
test: /(?:.(?!\.(?:test|stories|container)))+\.(?:m?[jt]s|[jt]sx)$/u,
338+
test: /^(?!.*\.(?:test|stories|container)\.)(?:.*)\.(?:m?[jt]s|[jt]sx)$/u,
339339
include: UI_DIR_RE,
340340
use: [reactCompilerLoader],
341341
},

0 commit comments

Comments
 (0)