This is a Next.js project bootstrapped with
create-next-app
.
This app demonstrates the use of custom entries and scripts to reduce the runtime JavaScript needed for high-content pages with low interactivity.
Custom entries do not work with hot-reload. To run the app with custom entries enabled:
npm run build
npm run start
Hot reload does still work with the app during the development stages:
npm run dev
On the various pages, with the Network tab open, perform a reload to notice the reduced JavaScript resources download, and resulting button interactivity.
Today, we cannot fully experiment with Webpack configuration because of Next.js
internals. On install, this app monkey-patches Next.js to introduce a
webpackFinal
config method, allowing us to experiment with the final Webpack
config.
A proposal has been submitted to Next.js for this to be a resident feature:
Original Pull Request moved to
Issue
Discussion