-
Run
npm init -y
fast initialization Project -
Created in the root directory of the project
src
source code directory anddist
product catalog -
Created in the src directory
index.html
-
Use cnpm installation webpack, run
cnpm i webpack webpack-cli -D
-
How to install
cnpm
: a global runnpm i cnpm -g
-
-
Note: webpack 4.x greater than the convention provides a conceptual configuration; purpose is to minimize the volume of the configuration file;
-
Default agreed:
-
Entrance is packaged
src
->index.js
-
The output file is packaged
dist
->main.js
-
4.x added a
mode
option (as required), optional value:development
andproduction
;
-
Creating Webpack 4.X project
Guess you like
Origin www.cnblogs.com/it-Ren/p/11408862.html
Recommended
Ranking