Skip to content

Commit

Permalink
Use regex instead of an exclude function
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Apr 19, 2024
1 parent d2e83f7 commit 43abdec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
7 changes: 1 addition & 6 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,7 @@ module.exports = function setKarmaConfig(config) {
{
test: /\.(js|ts|tsx)$/,
loader: 'babel-loader',
exclude: function ignore(filePath) {
if (filePath.includes('/node_modules/')) {
return !filePath.includes('/node_modules/@mui/monorepo');
}
return false;
},
exclude: /node_modules\/.*\/node_modules\/(?!@mui\/monorepo)/,
},
],
},
Expand Down
9 changes: 1 addition & 8 deletions test/utils/setupBabel.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
require('@babel/register')({
extensions: ['.js', '.ts', '.tsx'],
ignore: [
function ignore(filePath) {
if (filePath.includes('/node_modules/')) {
return !filePath.includes('/node_modules/@mui/monorepo');
}
return false;
},
],
ignore: [/node_modules\/.*\/node_modules\/(?!@mui\/monorepo)/],
});
7 changes: 1 addition & 6 deletions webpackBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ module.exports = {
rules: [
{
test: /\.(js|ts|tsx)$/,
exclude: function ignore(filePath) {
if (filePath.includes('/node_modules/')) {
return !filePath.includes('/node_modules/@mui');
}
return false;
},
exclude: /node_modules\/.*\/node_modules\/(?!@mui)/,
loader: 'babel-loader',
options: {
cacheDirectory: true,
Expand Down

0 comments on commit 43abdec

Please sign in to comment.