Large-scale multi-page SPA project architecture based on VUE-CLI reconstruction.

Large projects are bound to consist of multiple single-page applications and, due to the history of traditional page maintenance, are likely to coexist with non-single-page applications.

This project architecture supports the sharing of common components and resources, the isolation of compilation and output of each SPA application, and supports asynchronous components within the SPA. Perfect support for multiple people to develop large SPA projects at the same time.

configuration

Development phase don’t have to care about, the compiler output to modify the build/webpack base. Conf., js file currSPA variables for the current to compile a single page application, it has a value of the SRC/page directory corresponding SPA applications.

Suppose the current test single-page application is developed and will compile output, then change to:

Const currSPA = "test"Copy the code

The resulting files are in the dist/test directory, isolated from other spAs.

Matters needing attention

The page directory must exist, and other directories can be modified to suit your custom.