* Replaces 'dist/' or './dist/' prefix from a file path with './' * Only matches at the start of the path to avoid false matches * @param {string} filePath - The file path to process * @returns {string} The path without dist prefix
(filePath)
| 38 | * @returns {string} The path without dist prefix |
| 39 | */ |
| 40 | function replaceDist(filePath) { |
| 41 | // Only match dist/ at the beginning of the path, followed by a filename |
| 42 | // This prevents matching strings like "distributed/file.js" or "some/dist/path" |
| 43 | return filePath.replace(/^(?:\.\/)?dist\/(?=.+)/, './') |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Recursively processes package.json `exports` to remove dist prefixes |
no outgoing calls
no test coverage detected