Introduction to the

The project is a scaffold removed from the daily development of the project to facilitate subsequent development. Scaffolding is configured with es6-7-8+ CSSNext + VUE development environment by default, but is not limited to VUE development. And optimize the packaging process of Webpack. Support single page/multi-page development, support code cutting asynchronous loading, interested please refer to the Webpack Chinese document # code separation.

For those unfamiliar with the new grammar, please refer to:

  • Es6: Ruan Yifeng es6 introduction
  • Cssnext: postcss website
  • Vue: VUE Chinese official website

packaging

The project is configured with three code environments by default, namely production(formal environment), Production -D (test environment) and Development (development).

The test environment is packaged in the same way as the official environment and is mainly used for code tuning in the official and beta versions. The development version is relatively simple, eliminating code compression and other unnecessary optimizations, supporting development hot update.

Scaffolding uses DllPlugin + DllReferencePlugin to package external resource packages to optimize the packaging speed. Manifest and packaged file packages are placed in the static/libs/ JS directory, and can also enter the script self-configuration path.

build

npm run buildCopy the code

DLL (Package external resource libraries)

npm run build:vendors
Copy the code

If you need to package the external resource repositories, run the Build: Vendors command to package the external resource bundles, and then do the build.

The basic format of each page item

My - page (the name of the page) ├ ─ ─ index. The HTML (page rendering HTML template) ├ ─ ─ js │ └ ─ ─ index. The js script entrance (page) └ ─ ─ style (style file) of the pageCopy the code

configuration

The basic configuration of scaffolding is the config/base.js file. Modifying the configuration file will affect the packaging effect.