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

fix extension resolving for esbuild #1827

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

mansona
Copy link
Member

@mansona mansona commented Feb 29, 2024

We have implemented extension searching on the Vite side of a build, but in #1779 our templates are starting to get analysed in esbuild and need the same "extension candidate" implementation 👍

@mansona mansona added the bug Something isn't working label Feb 29, 2024
@patricklx
Copy link
Contributor

patricklx commented Feb 29, 2024

i'm not sure what changed, but vite adds its own plugin to esbuild:vite:dep-scan, which then calls all vite plugins. So it should go through vite/src/hbs.ts etc
and currently it also goes into build.onLoad({ filter: /\.g[jt]s$/ }, async ({ path: filename })...

@mansona mansona mentioned this pull request Mar 1, 2024
6 tasks
@patricklx
Copy link
Contributor

this could also be fixed by setting the extensions resolving in vite config.

https://vitejs.dev/config/shared-options#resolve-extensions

which would also need to be done for rollup with an extra plugin...

@ef4 ef4 merged commit 6d64eff into main Mar 5, 2024
95 checks passed
@ef4 ef4 deleted the esbuild-extension-resolution branch March 5, 2024 15:17
@github-actions github-actions bot mentioned this pull request Mar 4, 2024
@ef4
Copy link
Contributor

ef4 commented Mar 5, 2024

We discussed this and @patricklx's questions are good ones. We think vite does not add custom rollup plugins to the esbuild when doing dep pre-building. We can probably rely on resolve-extensions for gjs and gts, but the hbs rollup plugin has more complex behaviors. We can experiment with slightly simplifying our plugins in favor of resolve-extensions but it would not completely replace them.

@github-actions github-actions bot mentioned this pull request Apr 4, 2024
@github-actions github-actions bot mentioned this pull request Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants