-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] Build ToolingIssues or PRs related to build toolingIssues or PRs related to build tooling
Description
Description
The npm run build command fails when the repository is located in a path containing
a dot-prefixed directory, such as .worktrees/ (commonly used for git worktrees).
Steps to Reproduce
- Create a git worktree in a dot-prefixed directory:
mkdir .worktrees git worktree add .worktrees/my-feature my-branch cd .worktrees/my-feature - Run
npm install - Run
npm run build
Expected Behavior
Build completes successfully, with .native.js, .ios.js, and .android.js files
excluded from the web build.
Actual Behavior
Build fails with errors like:
Could not resolve "./styles.scss"
packages/primitives/src/horizontal-rule/index.native.js:14:19
Root Cause
fast-glob's ignore patterns don't match files inside dot-prefixed directories by
default. The IGNORE_PATTERNS array includes **/*.native.*, but this pattern fails
to match when the absolute path contains .worktrees/.
Who is Impacted
- Developers using git worktrees in dot-prefixed directories
- CI/CD systems that clone repositories into dot-prefixed paths
- Any workflow where the repository path contains a directory starting with
.
Solution
Add dot: true to the fast-glob options in packages/wp-build/lib/build.mjs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] Build ToolingIssues or PRs related to build toolingIssues or PRs related to build tooling