MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / defineEsmAndCommonJsConfig

Function defineEsmAndCommonJsConfig

packages/tooling/src/vite.ts:65–83  ·  view source on GitHub ↗
(entry: string)

Source from the content-addressed store, hash-verified

63}
64
65export 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`

Callers

nothing calls this directly

Calls 4

defaultBuildUserConfigFunction · 0.85
commonjsFunction · 0.85
esmFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected