()
| 58 | |
| 59 | // Resolve @react-spectrum/s2/illustrations/* imports |
| 60 | function illustrationResolverPlugin(): Plugin { |
| 61 | return { |
| 62 | name: 'illustration-resolver', |
| 63 | enforce: 'pre', |
| 64 | resolveId(source) { |
| 65 | if (source.startsWith('@react-spectrum/s2/illustrations/')) { |
| 66 | const illustrationPath = source.replace('@react-spectrum/s2/illustrations/', ''); |
| 67 | const tsxPath = path.resolve(s2Dir, 'spectrum-illustrations', illustrationPath + '.tsx'); |
| 68 | |
| 69 | if (fs.existsSync(tsxPath)) { |
| 70 | return tsxPath; |
| 71 | } |
| 72 | |
| 73 | return null; |
| 74 | } |
| 75 | return null; |
| 76 | } |
| 77 | }; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Handle S2 illustrations. |
no outgoing calls
no test coverage detected