Skip to content

Commit

Permalink
Merge pull request #35 from nextcloud-libraries/fix/cjs-esm-interop
Browse files Browse the repository at this point in the history
fix(libConfig): import default in CJS build
  • Loading branch information
susnux authored Oct 6, 2023
2 parents 28a71a8 + b108a87 commit 6ed5a46
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/libConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const createLibConfig = (entries: { [entryAlias: string]: string }, optio
const extension = format === 'es' ? 'mjs' : (format === 'cjs' ? 'cjs' : `${format}.js`)
return {
format,
interop: 'auto', // Add __esModule for CJS externals imports to fix interop issues in tools like Babel/TS
hoistTransitiveImports: false, // For libraries this might otherwise introduce side effects
preserveModules: false,
assetFileNames,
Expand Down

0 comments on commit 6ed5a46

Please sign in to comment.