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

Enable multiple matches in AsyncAlpine.alias() #32

Closed
scruffymongrel opened this issue Oct 6, 2023 · 2 comments · Fixed by #37
Closed

Enable multiple matches in AsyncAlpine.alias() #32

scruffymongrel opened this issue Oct 6, 2023 · 2 comments · Fixed by #37
Labels
bug Something isn't working

Comments

@scruffymongrel
Copy link
Contributor

I have components organised as follows:

components/
  Button/
    Button.island.js
    Button.jsx

In my Vite entry file, I'm using AsyncAlpine.alias('components/[name]/[name].island.js').

As only the first instance of [name] is replaced, I get a 404 on http://localhost:5173/components/Button/[name].island.js.

If I remove the second instance of [name] and rename Button.island.js to island.js, everything works as expected.

Would you be happy to enable replacement of multiple instances of [name] in AsyncAlpine.alias()?

@Accudio
Copy link
Owner

Accudio commented Oct 11, 2023

Yep absolutely, I'd definitely be happy to do that. That's something I missed due to using .replace instead of .replaceAll.

I can update next week, or you're welcome to make a PR with that change.

@Accudio Accudio added the bug Something isn't working label Oct 11, 2023
@scruffymongrel
Copy link
Contributor Author

Excellent. Have created a PR (#34). Thanks :)

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 a pull request may close this issue.

2 participants