Commit 673aed3
fix(ci): add webpack aliases for workspace packages in Cypress config
Fix Cypress component tests failing with "Cannot resolve '@instructure/ui'" errors.
Issue: Cypress webpack running in its own context cannot resolve pnpm workspace
packages even with hoisted node-linker, because packages aren't in node_modules
in the expected locations.
Solution: Dynamically generate webpack aliases that map all @instructure/* packages
to their actual workspace locations in packages/*/. This allows Cypress webpack to
resolve both top-level imports (@instructure/ui) and deep imports
(@instructure/ui-button/src/...).
Implementation:
- Added getWorkspaceAliases() function that scans packages/ directory
- Generates aliases for all workspace packages
- Supports both package root and /src paths
This is the pnpm-compatible approach to module resolution for Cypress component tests.
Fixes: Cypress component tests and visual regression tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent d6daed4 commit 673aed3
1 file changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
2 | 29 | | |
3 | 30 | | |
4 | 31 | | |
5 | 32 | | |
6 | 33 | | |
| 34 | + | |
7 | 35 | | |
8 | 36 | | |
9 | 37 | | |
| |||
0 commit comments