Improve readability of transformIgnorePatterns

This commit is contained in:
Koen Vlaswinkel 2024-08-30 11:23:57 +02:00
Родитель 0a2ade3c9d
Коммит 97c497bbd6
1 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

@ -1,4 +1,26 @@
export const transformIgnorePatterns = [
// These use ES modules, so need to be transformed
"node_modules/(?!(?:@vscode/webview-ui-toolkit|@microsoft/.+|@octokit/.+|before-after-hook|d3|d3-(.*)|delaunator|exenv-es6|internmap|nanoid|p-queue|p-timeout|robust-predicates|universal-user-agent)/.*)",
// These are all the packages that DO need to be transformed. All other packages will be ignored.
// These pacakges all use ES modules, so need to be transformed
const transformScopes = ["@microsoft", "@octokit"];
const transformPackages = [
"@vscode/webview-ui-toolkit",
"before-after-hook",
"d3",
"delaunator",
"exenv-es6",
"internmap",
"nanoid",
"p-queue",
"p-timeout",
"robust-predicates",
"universal-user-agent",
];
const transformWildcards = ["d3-(.*)"];
const transformPatterns = [
...transformScopes.map((scope) => `${scope}/.+`),
...transformPackages,
...transformWildcards,
];
export const transformIgnorePatterns = [
`node_modules/(?!(?:${transformPatterns.join("|")})/.*)`,
];