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

Replace Laravel Mix with Vite #1129

Closed
7 tasks
caendesilva opened this issue Feb 27, 2023 · 3 comments
Closed
7 tasks

Replace Laravel Mix with Vite #1129

caendesilva opened this issue Feb 27, 2023 · 3 comments

Comments

@caendesilva
Copy link
Member

caendesilva commented Feb 27, 2023

Replace Laravel Mix with Vite #1129

Abstract

As this is now the default for Laravel applications, we should also use Vite as the default frontend asset bundler for new HydePHP projects.

Internal development notes

Resources

Tasks

  • Remove Laravel Mix files
  • Add Vite starter configuration files
  • Use Vite to generate assets
  • Update documentation
  • Update monorepo CI
  • Verify compatibility in downstream repositories
  • Migrate Webpack aliases to Vite config?
@caendesilva caendesilva mentioned this issue Feb 27, 2023
26 tasks
@caendesilva caendesilva added this to the v1 milestone Feb 27, 2023
@caendesilva
Copy link
Member Author

caendesilva commented Feb 27, 2023

Closing as Vite is not at all a good fit for HydePHP. I have build quite a few sites with Hyde and never really had any issues with Webpack/Mix. Moving to Vite would require a special wrapper (meaning it would wrap the wrapper that wraps a wrapper -- which makes as little sense as that sentence) to transform the generated files. And at this point I don't even know the problem I'm solving. Sure Vite is the new and cool thing, but it just isn't needed here. I'm sure it's great for Laravel apps using Vue or another JS frontend and you want HMR, but here were we just want to compile some Tailwind it's just overkill. Webpack works great, and if you want lightning fast TailwindCSS compilation, just turn on the Play CDN with a single config setting!

@caendesilva caendesilva closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
@caendesilva caendesilva removed this from the v1 milestone Feb 27, 2023
@caendesilva
Copy link
Member Author

Reconsidering this for HydePHP v2 #1499 as Vite has now evolved from a "shiny new thing" to the de-facto standard for Laravel.

Key changes from Laravel Mix to Vite:

  • Simpler configuration with Vite
  • Faster development builds with HMR support
  • Better production optimization
  • Modern ESM-based development
  • Built-in dev server at port 5173 instead of Mix's watch command

And main part: Match new Laravel syntax of npm run build. And we can use HMR as a BrowserSync replacement.

@caendesilva
Copy link
Member Author

Implemented in #2010

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

1 participant