Skip to content

Commit

Permalink
Aug 4, 2024, 1:15 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 4, 2024
1 parent c0ba703 commit d09d52c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -45,7 +48,7 @@ export default [
}),

// Handling extension issues
// addJsExtension(),
addJsExtension(),

// nodeResolve({
// extensions: ['.js', '.ts'],
Expand Down

0 comments on commit d09d52c

Please sign in to comment.