Reputation: 67
I started playing around with my first Next.js project.
After creating a new project via create-next-app
, I ran the performance-tab in the web-app 'Lighthouse' (the results can be viewed in the tabs below). The performance report returned a score of 79, however; all the other test were above 90.
Can someone explain to me why these are the results?
The project is newly created, and totally empty, one would assume a performance report to return a great score for such a project, but it did not. If you have any insight that could help to clarify why the performance test is returning with the results that I explained above, it will be appreciated. Thank you!
Upvotes: 6
Views: 2875
Reputation: 1795
I think you are running the test on the development server. In the development mode, there are a lot of unused js codes are being used. That's why the performance is a bit slow. You can check the production build.
All you have to do is:
npm build
npm start
(if your dev server is running on port 3000, then run npm start -p 5000
)http://localhost:5000
and run the lighthouse. I think the performance will be better.Upvotes: 7