Skip to content

Commit 713aa39

Browse files
committed
Fix babel config regex to only match top-level ui/
1 parent d0321db commit 713aa39

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

babel.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path');
22

33
module.exports = function (api) {
44
api.cache(false);
5+
const slash = `\\${path.sep}`;
56
return {
67
parserOpts: {
78
strictMode: true,
@@ -11,7 +12,10 @@ module.exports = function (api) {
1112
},
1213
overrides: [
1314
{
14-
test: /\/ui\/(?:components|contexts|hooks|layouts|pages)\/.+(?!\.(?:test|stories|container))\.(?:m?[jt]s|[jt]sx)$/u,
15+
test: new RegExp(
16+
`^${path.join(__dirname, 'ui')}${slash}(?:components|contexts|hooks|layouts|pages)${slash}.+(?!\\.(?:test|stories|container))\\.(?:m?[jt]s|[jt]sx)$`,
17+
'u',
18+
),
1519
exclude: /\/node_modules\//u,
1620
plugins: [['babel-plugin-react-compiler', { target: '17' }]],
1721
},

0 commit comments

Comments
 (0)