Home > Article > Web Front-end > Steps to install Webpack using the command line
This article brings you the steps to install Webpack using the command line. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Weback command line installation
Step one:
npm install webpack -g //全局安装
Step two:
npm init //初始化
Step three:
npm install –save-dev webpack //项目目录的安装 –save-dev是在开发中使用,-save要保存到package.json里面
Step 4:
webpack -v //检查版本号
npm install When installing an npm package, there are two command parameters that can write their information into package.json files, one is npm install
–save The other one is npm install –save-dev. The superficial difference between them is that –save will add the dependent package name to package.json
file dependencies key, –save-dev is added to the package.json file devDependencies key
The modules listed under devDependencies are what we use during development
The modules under dependencies are the modules we still need to rely on after publishing (that is, the dependent modules used in production)
Related recommendations:
webpack basics --Installation Tutorial
My Webpack Suite_html/css_WEB-ITnose
Webpack installation and basic packaging Detailed explanation of usage and command parameters
The above is the detailed content of Steps to install Webpack using the command line. For more information, please follow other related articles on the PHP Chinese website!