webpack5.0 installation and use

webpack5.0 installation and use

In the previous words, because of the different versions, the installation method and related instruction writing methods will also be different. The latest version is
Insert picture description here

1. Download node.js
2. Enter the following code in cmd, first install the webpack command into the computer globally through
npm install webpack -g
3. The cmd cd command makes the current directory go to the directory of the current project, and then enter the following This command generates a package.json file

npm init
Insert picture description here
completed the
"pit one"
JS file packaging command as
webpack ./src/main.js -o ./dist/bundle.js --mode=development

Construction of development environment

Guess you like

Origin blog.csdn.net/qq_44073682/article/details/115081284