(entry: string)
| 63 | } |
| 64 | |
| 65 | export function defineEsmAndCommonJsConfig(entry: string) { |
| 66 | return defineConfig(({ mode }) => { |
| 67 | const config = defaultBuildUserConfig(); |
| 68 | |
| 69 | const libName = path.parse(entry).name; |
| 70 | |
| 71 | switch (mode) { |
| 72 | case 'cjs': |
| 73 | commonjs(config, __dirname, libName, entry); |
| 74 | break; |
| 75 | // case 'esm': |
| 76 | default: |
| 77 | esm(config, __dirname, libName, entry); |
| 78 | break; |
| 79 | } |
| 80 | |
| 81 | return config; |
| 82 | }); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Builds Vite `resolve.alias` entries from the project's `tsconfig.json` |
nothing calls this directly
no test coverage detected