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

[9.x] Add Vite asset path generation method #44037

Merged
merged 1 commit into from
Sep 7, 2022
Merged

Conversation

wilsenhc
Copy link
Contributor

@wilsenhc wilsenhc commented Sep 7, 2022

This PR adds a method to the Vite class so the the way the asset URLs are generated can be separated from the main class.

This would make it so Teams/Projects that have their own way of loading assets can extend the functionality of the Vite class and add their own method of loading assets.

This would ease the path of migrations from Laravel-Mix to Vite for those teams.

The assetPath() method has the same signature as the global asset() helper

@taylorotwell taylorotwell merged commit de80ce6 into laravel:9.x Sep 7, 2022
@timacdonald
Copy link
Member

Just note that the vite-plugin uses the ASSET_URL under the hood as well, so swapping this may not work as intended.

I'd recommend just setting the ASSET_URL in your different teams as needed.

@peterthomson
Copy link

I'd recommend just setting the ASSET_URL in your different teams as needed.

Just FYI, a delta between the asset URL and the physical folder can be weird, annoying and confusing. But it's the whole point of this (and similar optional customisations) in webpack / mix. For example shared hosting often has weird symlinks and rules around public folders. These types of customisations help the build pipeline for those developers.

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.

4 participants