-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
[2.x] Replace Laravel Mix with Vite #2010
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## new-asset-system #2010 +/- ##
====================================================
Coverage 100.00% 100.00%
Complexity 1891 1891
====================================================
Files 194 194
Lines 5044 5044
====================================================
Hits 5044 5044 ☔ View full report in Codecov by Sentry. |
Since if ($this->option('run-dev')) {
$this->runNodeCommand('npm run dev', 'Building frontend assets for development!');
} And update this:
|
Clause response to renamed build flagBased on the provided code and context, I'll analyze the situation and provide some suggestions for renaming the flags. Current situation: protected $signature = 'build
{--run-dev : Run the NPM dev script after build}
{--run-prod : Run the NPM prod script after build}
{--run-prettier : Format the output using NPM Prettier}
{--pretty-urls : Should links in output use pretty URLs?}
{--no-api : Disable API calls, for example, Torchlight}'; The current flags
Here are my suggestions, ordered by preference: 1.
|
Think I will go with |
Abstract
Important: You must now use
npm run build
instead ofnpm run prod
Motivation
Key changes from Laravel Mix to Vite:
npm run build
.Community support
Vite is also winning by a landslide by a community vote
Laravel Mix vs Vite Benchmark
All cases have had the NPM command been run before the benchmark to warmup any caches. Note that the benchmarks did not run enough iterations to get an accurate average. Tests were run on Windows.
Laravel Mix:
9694 ms
8907 ms
9300 ms
Vite:
4628 ms
4518 ms
4575 ms
Analysis
Vite is approximately 52% faster than Laravel Mix, in other words it's about twice as fast.