From 936b45148b58d15c9c843f0503f7bdf12b9da4e9 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Fri, 2 Jul 2021 18:44:32 +0200 Subject: [PATCH] fix(babel-make-styles): update regex for rules (#18816) --- ...l-make-styles-7135d933-ff17-4a52-82b3-c445affe6aff.json | 7 +++++++ packages/babel-make-styles/src/utils/evaluatePathsInVM.ts | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 change/@fluentui-babel-make-styles-7135d933-ff17-4a52-82b3-c445affe6aff.json diff --git a/change/@fluentui-babel-make-styles-7135d933-ff17-4a52-82b3-c445affe6aff.json b/change/@fluentui-babel-make-styles-7135d933-ff17-4a52-82b3-c445affe6aff.json new file mode 100644 index 0000000000000..5520c134643c3 --- /dev/null +++ b/change/@fluentui-babel-make-styles-7135d933-ff17-4a52-82b3-c445affe6aff.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix: update regex for rules", + "packageName": "@fluentui/babel-make-styles", + "email": "olfedias@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/babel-make-styles/src/utils/evaluatePathsInVM.ts b/packages/babel-make-styles/src/utils/evaluatePathsInVM.ts index 90a2349efaa9c..eb4c62cd55176 100644 --- a/packages/babel-make-styles/src/utils/evaluatePathsInVM.ts +++ b/packages/babel-make-styles/src/utils/evaluatePathsInVM.ts @@ -16,9 +16,11 @@ function evaluate(code: string, filename: string, babelOptions: TransformOptions evaluate: true, rules: [ + /* TODO: rules should be configurable */ + { action: shakerEvaluator }, { - test: /\/node_modules\//, + test: /[/\\]node_modules[/\\]/, action: 'ignore', }, ],