Skip to content

Commit

Permalink
fix: node and browser should handle dynamic default import
Browse files Browse the repository at this point in the history
  • Loading branch information
davidenke committed Nov 12, 2024
1 parent c4c5f6c commit 76dd674
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/decap.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export async function parseConfig(ymlData: string): Promise<CmsConfig | undefine
}

// load the original tooling...
const { default: decapConfig } = await import('decap-cms-core/dist/esm/actions/config.js');
let decapConfig = await import('decap-cms-core/dist/esm/actions/config.js');
if ('default' in decapConfig) decapConfig = decapConfig.default as any;

try {
return decapConfig.normalizeConfig(decapConfig.parseConfig(ymlData) ?? {});
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": false,
"module": "ESNext",
Expand Down

0 comments on commit 76dd674

Please sign in to comment.