Skip to content

Commit

Permalink
fix: Stop running fencing logic on node_modules (#10164)
Browse files Browse the repository at this point in the history
## **Description**

Stops running fencing logic on `node_modules`, mirroring the extension
implementation. There is no reason for us to run fencing on code coming
from `node_modules` anyway. This may have a potential positive
performance impact as well during build-time.
  • Loading branch information
FrederikBolding authored Jun 28, 2024
1 parent f2dad68 commit d540b75
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion metro.transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ module.exports.transform = async ({ src, filename, options }) => {
* Params based on builds we're code splitting
* i.e: flavorDimensions "version" productFlavors from android/app/build.gradle
*/
if (fileExtsToScan.includes(path.extname(filename))) {
if (
!path.normalize(filename).split(path.sep).includes('node_modules') &&
fileExtsToScan.includes(path.extname(filename))
) {
const [processedSource, didModify] = removeFencedCode(filename, src, {
all: availableFeatures,
active: getBuildTypeFeatures(),
Expand Down

0 comments on commit d540b75

Please sign in to comment.