Home  >  Article  >  Web Front-end  >  Steps to install Webpack using the command line

Steps to install Webpack using the command line

不言
不言Original
2018-08-18 15:08:501636browse

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        //检查版本号

Extension:

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn