Directory structure
- SRC +
- Page
- View
- Image
- Service
- Util
Git initialization
NPM initialization
- NPM Init initializes NPM
- NPM Install dependency Package
- NPM Install < dependency pack >[@ version number]
- NPM Uninstall Offload Dependency Package
- G Global Installation
Webpack installation Configuration
-
Webpack installation
- NPM install webpack-g Global installation
- npm install webpack @1.15.0--save-dev Project Security Install
- webpack-v View version--save-dev development AIDS dependency--save business code Dependency package
-
Configure webpack.config.js
entry:js Portal file Externals: Externally dependent claims output: Target file Resolve: Configuration alias module: Various files, various loader plugins: plug-in
- P>webpack loaders
- html:html-webpack-plugin/html-loader
- Js:babel-loader + babel-preset-es2015
- css:style-loader+css-loader
- image+font:url-loader
-
Common commands
webpack do not compress packaging
- webpack-p on-line publishing compressed packaging
- webpack--watch listening static file changes automatic compilation
- webpack--config WEBP Ack.config.js configuration
- webpack [-p] [source file] [destination file]
- Front-end development Server Webpack-dev-server NPM install Webpac K-dev-server--save-dev
webpack-dev-server/client?http://localhost:8080
Webpack-dev-server--port 8088-- Inline
Git+webpack Project Initialization