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

Place assets on CDN during lasso:pull #77

Open
haugstrup opened this issue Jan 7, 2024 · 3 comments
Open

Place assets on CDN during lasso:pull #77

haugstrup opened this issue Jan 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@haugstrup
Copy link

I may be missing something really obvious and if so I apologize. The Lasso workflow is like:

  • Run lasso:publish on my local machine or in CI and a zip file is placed on a filesystem
  • Run lasso:pull on the server and it grabs that zip file and unzips it so the built assets can be served to visitors

I have a perfectly good CDN sitting around (that's where the zip file is uploaded to). Is there no way to have the JS/CSS bundles be put onto the CDN (unzipped) so my website visitors can download assets from the CDN instead of from y webserver?

@Sammyjo20
Copy link
Owner

Hey @haugstrup

No don't worry you're not missing something! That is not currently a feature of Lasso, however it is something I would love for it to be able to do. Maybe it could modify the mix-manifest file to point to the CDN instead when you run lasso:pull?

@Sammyjo20 Sammyjo20 added the enhancement New feature or request label Jan 7, 2024
@haugstrup
Copy link
Author

I will fully admit that my knowledge of Max is pretty limited. I did find old documentation that setting a MIX_ASSET_URL env option should change the URL Mix generates: https://laravel.com/docs/8.x/mix#custom-mix-base-urls

I can't find reference to it in the current documentation so I don't know if it still exists (I'd think so though).

lasso:publish could publish unzipped assets along with the zipped ones and then people could set MIX_ASSET_URL to point to the CDN?

@Sammyjo20
Copy link
Owner

It's been a while for me too, but that could work. The assets could be uploaded somewhere specified on the CDN (or just use a disk that points to the CDN) and then the user could define the CDN URL though mix. I'll have a think about it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants