Skip to content

Conversation

@timea-solid
Copy link
Member

ESM bundles were not working due to external libs. Now it should work

Copilot AI review requested due to automatic review settings December 7, 2025 13:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes ESM bundle generation by adjusting webpack's external dependencies configuration. Previously, ESM bundles were failing because external libraries (rdflib and solid-logic) were being mapped to global variables instead of being preserved as bare module specifiers. The fix introduces a separate esmExternals configuration that keeps the original import names, allowing browsers to resolve them via import maps.

Key changes:

  • Introduced new esmExternals configuration for ESM bundles in webpack that preserves bare module specifiers
  • Disabled concatenateModules optimization for ESM builds to prevent module resolution issues
  • Added a working HTML example demonstrating ESM bundle usage with import maps
  • Updated package version to 3.0.1 and several dependencies (solid-logic, mime-types, webpack, etc.)
  • Updated documentation examples to reference the new versions

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
webpack.config.mjs Added esmExternals configuration to preserve bare module imports for ESM builds; disabled concatenateModules optimization for ESM bundles
test/testBundles/test-bundle.html New HTML example demonstrating ESM bundle usage with import maps, showing login/profile button functionality
package.json Version bump to 3.0.1; updated dependencies (mime-types, solid-logic, TypeScript ESLint, jest, terser, webpack); removed unused @eslint/eslintrc
package-lock.json Lock file updates matching package.json dependency changes
README.md Updated ESM usage examples to pin specific versions (solid-logic@4.0.1, solid-ui@3.0.1) for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// ESM externals: keep imports
const esmExternals = {
rdflib: 'rdflib',
'solid-logic': 'solid-logic'
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is trailing whitespace at the end of this line. Consider removing it for consistency.

Suggested change
'solid-logic': 'solid-logic'
'solid-logic': 'solid-logic'

Copilot uses AI. Check for mistakes.
@timea-solid timea-solid merged commit f8ab6a2 into main Dec 7, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants