* Import map configuration. * @param {'preact' | 'react' | null} buildFor determines whether to include preact or react aliases or neither. By default, uses preact aliases (in addition to jsconfig paths). * @return {object}
(buildFor = 'preact')
| 62 | * @return {object} |
| 63 | */ |
| 64 | function getImportResolver(buildFor = 'preact') { |
| 65 | return { |
| 66 | root: ['.'], |
| 67 | alias: { |
| 68 | ...readJsconfigPaths(), |
| 69 | ...(buildFor ? moduleAliases(buildFor) : {}), |
| 70 | }, |
| 71 | extensions: ['.js', '.jsx', '.ts', '.tsx'], |
| 72 | stripExtensions: [], |
| 73 | babelOptions: { |
| 74 | caller: { |
| 75 | name: 'import-resolver', |
| 76 | }, |
| 77 | }, |
| 78 | }; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Produces an alias map with paths relative to the provided root. |
no test coverage detected