Implement code splitting and lazy loading for each page in the project. By dynamically importing JS files only when needed, the performance of the website can be improved significantly. This will ensure that only the necessary scripts are loaded for each page.
Lazy load pages dynamically
const pageModule = import(/* webpackChunkName: "[request]" */ ./src/views/${page}/${page}.js);
Implement code splitting and lazy loading for each page in the project. By dynamically importing JS files only when needed, the performance of the website can be improved significantly. This will ensure that only the necessary scripts are loaded for each page.
Lazy load pages dynamically
const pageModule = import(/* webpackChunkName: "[request]" */./src/views/${page}/${page}.js);