Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esbuild plugin: add proper support for lume url rewrites #685

Merged

Conversation

into-the-v0id
Copy link
Contributor

Description

As a follow up of PR #678. It's actually possible to pass esbuild a in/out path map as entryPoints. Esbuild will then rewrite the urls accodingly. I initially thought using that would disable/break entryNames but that is not the case. This allows us to get full support for lume url rewrites (basename and url) for esbuild.

This PR also extends that to the manual url rewriting done by lume when bundling via esbuild is disabled. And extends manual import rewriting to dynamic imports and standalone imports without a from.

Related Issues

Related to #678

Check List

  • Have you read the
    CODE OF CONDUCT
  • Have you read the document
    CONTRIBUTING
    • One pull request per feature. If you want to do more than one thing,
      send multiple pull request.
    • Write tests.
    • Run deno fmt to fix the code format before commit.
    • Document any change in the CHANGELOG.md.

@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch 4 times, most recently from 53af308 to c1a9c99 Compare November 1, 2024 13:51
into-the-v0id added a commit to into-the-v0id/lume that referenced this pull request Nov 1, 2024
@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch from c1a9c99 to d4bb414 Compare November 1, 2024 13:52
into-the-v0id added a commit to into-the-v0id/lume that referenced this pull request Nov 1, 2024
@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch from d4bb414 to 4e406c4 Compare November 1, 2024 15:02
into-the-v0id added a commit to into-the-v0id/lume that referenced this pull request Nov 1, 2024
@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch from 4e406c4 to 0609c79 Compare November 1, 2024 15:29
into-the-v0id added a commit to into-the-v0id/lume that referenced this pull request Nov 1, 2024
@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch from 0609c79 to 0792ac6 Compare November 1, 2024 15:30
Copy link
Member

@oscarotero oscarotero left a comment

Choose a reason for hiding this comment

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

That's a great approach!
I just left a comment becasue I don't think we need to create a new util function for this.
Early next week I'll review it more in depth and will merge it.
Thanks!

plugins/esbuild.ts Outdated Show resolved Hide resolved
@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch from 2cb5d61 to 0792ac6 Compare November 1, 2024 16:36
into-the-v0id added a commit to into-the-v0id/lume that referenced this pull request Nov 4, 2024
@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch from 78bc9a0 to 460142d Compare November 4, 2024 17:24
@into-the-v0id into-the-v0id force-pushed the feature/esbuild-url-rewrite branch from 460142d to f7cfd43 Compare November 4, 2024 17:25
@oscarotero oscarotero merged commit 4efee86 into lumeland:main Nov 4, 2024
6 checks passed
@into-the-v0id into-the-v0id deleted the feature/esbuild-url-rewrite branch November 4, 2024 22:05
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