Differences between vue-router configuration development environment and production environment

whether vue-router can be configured, or whether vue-router can be dynamically configured using webpack to meet the requirements:
1. All routes are available through one configuration of the json, development environment, and partial routing is disabled in the production environment;
2. Disabled routes will not be build

Aug.16,2021

Hello, landlord! Some time ago, I encountered this problem in the development of the project.
first sample source code

tell me my solution.
is distinguished by different commands, such as npm run dev (Development), npm run build (production. The contents of the route.config.js route file introduced by are dynamically generated based on these two commands. It is the contents of the file under the src/modules/router/dynamic path (here you can correspond to two files, one for all routes and one for production). You can take a closer look. If there is anything you don't understand, you can chat in private.

if it is helpful, please click to adopt it. Thank you.

Menu