You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Inaccurate Bundle Type Filtering in Rollup Build #29614
Observe the output of the shouldSkipBundle function logs within the build.js script.
Link to code example:
Relevant code: scripts/rollup/build.js
Relevant function: shouldSkipBundle
The current behavior:
The shouldSkipBundle function, responsible for determining whether to include a bundle in the build output, contains incorrect logic for filtering when multiple bundle types are specified. Specifically, the following line causes the issue:
This code uses Array.prototype.every with indexOf to check if all requested bundle types are missing in the current bundle type. However, when multiple types are specified, it should skip a bundle only if none of the requested types are present.
Here's an example of the incorrect behavior observed during debugging:
In this case, even though the bundleType is NODE_PROD and doesn't include NODE_DEV, isAskingForDifferentType is incorrectly evaluated as false, leading to the bundle not being skipped.
The expected behavior:
The shouldSkipBundle function should correctly filter bundles based on multiple requested types. In the example above, the expected behavior is that isAskingForDifferentType should be true for the NODE_PROD bundle type, as it does not include the NODE_DEV type.
In general, the function should return true (skip the bundle) only if none of the requested types are included in the current bundle type.
Activity
[chore] Fix TypeError in shouldSkipBundle During yarn build-for-devto…