-
The server uses Express. It should be noted that the only purpose is to provide webpack-dev-middleware and webpack-hot-middleware (Code hot replacement). Replace with a custom Express program webpack-dev-server To make it easier to implement universal rendering and to avoid making the package too large. -
Multi thread compilation is adopted for different loaders, which greatly speeds up the compilation speed. -
Use webpack DllReferencePlugin extracts fixed resources to speed up compilation and packaging. -
Start tree Shaking -
Start webpack3 version: scope promotion function -
Babel is equipped with transform runtime to optimize the code. -
Support mixed development of single page application and multi page application -
Automatically import CSS and JS files of the page. No need to set the URL manually -
Change file, anti cache hash rule -
The modularization of CSS uses postcss+postcss cssnext by default, and handles browser prefixes internally. [See more]( http://cssnext.io/ ) -
Fully support the latest features of ES6, package and escape to ES5 to support lower version browsers -
Quick compilation, hot update, automatic refresh
▄ - dist # Package resources ☆ -- internals # project configuration file │› -- webpack # webpack configuration folder │ L -- index. js # Public configuration file ☆ - static # Static resources, bypassing packaging directly ▄ -- app # program source file L --. cache loader # The cache file after the service is started, which is used to quickly start the service next time
-
In order to ensure the normal operation of the project, please update the relevant environment by yourself.
-
First clone project
$ git clone https://github.com/sayll/avalon-webpack-start.git $ cd avalon-webpack-start
-
Download dependency
-
Please ensure that your environment configuration is completed, and then you can start the following steps $ npm install # Install project dependencies $ npm start # Compile and launch
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
-
Used in the first run start , for subsequent debugging dev
-
Project Directory app in views Create a new folder in the directory. The folder name is the name of HTML -
The index.html, index.js, index.css in the file will be automatically indexed and packaged into resources static The directory is a static file directory, and resources can be accessed directly through '/static/*' -
The project closes eslint by default. Please go to internals/index.js to configure. -
Please go directly to internals/index.js Vendors configuration in.
For more configurations, please refer to
internals/index.js