(pathService: Path.Path)
| 104 | * @since 4.0.0 |
| 105 | */ |
| 106 | export const createResolveLocalPackageImports = (pathService: Path.Path): Plugin => ({ |
| 107 | name: "rollup-plugin-resolve-imports", |
| 108 | async resolveId(source, importer) { |
| 109 | const match = source.match(EFFECT_PACKAGE_REGEX) |
| 110 | if (Predicate.isNotNull(match)) { |
| 111 | const packageName = match[1] |
| 112 | const packageJson = await this.resolve(`${packageName}/package.json`, importer, { skipSelf: true }) |
| 113 | if (packageJson === null) return null |
| 114 | const resolved = await this.resolve(source, importer, { skipSelf: true }) |
| 115 | if (resolved === null) return null |
| 116 | return { |
| 117 | ...resolved, |
| 118 | id: toLocalDistPath(pathService, pathService.dirname(packageJson.id), resolved.id), |
| 119 | external: false |
| 120 | } |
| 121 | } |
| 122 | return null |
| 123 | } |
| 124 | }) |
| 125 | |
| 126 | /** |
| 127 | * Creates the full Rollup plugin pipeline for bundling. |
no outgoing calls
no test coverage detected