From d09d52c00ea3e6bf8029dd9204a20593f3c4efb1 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Sun, 4 Aug 2024 17:15:41 +0000 Subject: [PATCH] Aug 4, 2024, 1:15 PM --- rollup.config.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 10b9621..af78211 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -10,11 +10,14 @@ function addJsExtension() { return { name: 'add-js-extension', resolveId(source, importer) { - if (source.startsWith('@acala-network/sdk/')) { - return { - id: source + '.js', - external: true - }; + // Check if the output format is 'es' (for .mjs) + if (this.getModuleInfo(importer).isEntry && this.getOutputOptions().format === 'es') { + if (source.startsWith('@acala-network/sdk/')) { + return { + id: source + '.js', + external: true + }; + } } return null; } @@ -45,7 +48,7 @@ export default [ }), // Handling extension issues - // addJsExtension(), + addJsExtension(), // nodeResolve({ // extensions: ['.js', '.ts'],