webpack installation

webpack run git command-driven environment based node

Installation general idea to install in the global -g -D downloads

Top step (global)

Establish the destination folder to run git

First global under webpack 

 cnpm install webpack -g

Download webpack-cil global

 npm install webpack -cli -g

      At this point run webpack not being given a warning support is not configured to run the default entry for the index file under src, js file

 Run webpack default

webpack

Specifies the target package (custom entry file)

webpack  demo.js -o  bundle.js

Packaged demo, js file output to bundle.js

Import and export modules under way with reference to article

 

 

Development Environment installation webpack 

Steps

Initialization properties

npm init
//初始化项目   出现package.json

Download the development environment webpack

cnpm install webpack --save-dev

cnpm install webpack -D 
//进入项目后下载环境都是局部  -D

 

 

After the download is complete for the required plug-in installed

 cnpm jquery -D
//下载所有插件均是此项目下

loader to package installation files for different formats

cnpm install style-loader css-loader less-loader less -D

After it pulled out of the plug-in installation file independent processing for file

cnpm install html-webpack-plugin -D
//其他插件雷同

 

Published 56 original articles · won praise 1 · views 1242

Guess you like

Origin blog.csdn.net/qq_40819861/article/details/101157280