webpack用来干什么
1.转义代码
2.构建bulid
3.代码分析
4.代码压缩
- 全局安装
mpnnpm install -g webpack@4 webpack-cli@3
yarnyarn global add webpack@4 webpack-cli@3
- 局部安装
yarnyarn init -y
yarn add webpack@4 webpack-cli@3
npm init -y
npm install webpack webpack-cli —save-dev
~~~
这个报错的解决方法:
ERROR in Entry module not found: Error: Can’t resolve ‘./src’ in ‘D:\yerui\webpack’
没有配置文件,需要手动指定一下webpack选项,
执行:npx webpack ./src/main.js -o dist/main.js 即可
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!