diff --git a/src/codegen.ts b/src/codegen.ts index b99ba54..7c13a0e 100644 --- a/src/codegen.ts +++ b/src/codegen.ts @@ -16,9 +16,7 @@ export const codegen = ( const cssFn = args.artifacts.find((a) => a.id === 'css-fn'); const index = args.artifacts.find((a) => a.id === 'css-index'); - const indexFile = index?.files.find( - (f) => f.file.includes('index.mjs') || f.file.includes('index.js'), - ); + const indexFile = index?.files.find((f) => f.file.match(/^index\.(mjs|js)/)); const indexDtsFile = index?.files.find((f) => f.file.includes('index.d.')); const ext = indexFile?.file.split('.').at(-1); const dtsExt = indexDtsFile?.file.split('.').at(-1);