- 面向过程的思想
- 面向对象的思想
- webpack思想
初始化webpack
npm init
初始化项目后打开文件会生成package.json文件
{
"name": "lesson1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
安装完webpack-cli会多一个文件 node-moudles
npm install webpack-cli --save-dev
编译index.js的文件,会多出一个dist文件,记得每次修改index.js文件之后都需要编译index.js
npx webpack index.js