多端阅读《Webpack官方文档》:
- 在PC/MAC上查看:下载w3cschool客户端,进入客户端后通过搜索当前教程手册的名称并下载,就可以查看当前离线教程文档。下载Webpack官方文档离线版客户端
- 在手机APP上查看:请从各大安卓应用商店、苹果App Store搜索并下载w3cschool手机客户端,在App中搜索当前教程手册的名称查看。下载w3cschool手机App端
- 在手机上查看文档:https://m.w3cschool.cn/webpack_doc/
手册简介:
webpack是一款模块加载器兼打包工具,它能把各种资源,例如JS(含JSX)、coffee、样式(含less/sass)、图片等都作为模块来使用和处理。
手册说明:
《Webpack官方文档》寄语
在学习Webpack的过程中,你可能会遇到各种问题:Webpack中传入配置对象出错了怎么办?配置模块如何解析?配置如何展示性能提示?等等的诸多问题,要想解决这些问题,轻松学习Webpack,欢迎参考《Webpack官方文档》!
Webpack 的版本
现在 Webpack 有两个可用的版本,分别是标准和测试版,测试版使用 -beta 标记区分。测试版包含不稳定和带有实验性质的特征,并且没有全面的测试,因此最好选择使用标准版的 Webpack。
安装 Webpack
- 在开始之前,请确保安装了 Node.js 的最新版本。
- Node.js 自带的软件包管理器 npm 安装Webpack。
$ npm install webpack -g
-
此时 Webpack 已经安装到了全局环境下,可以通过命令行 webpack -h 查看相关指令;通常我们会将Webpack安装到项目依赖,这样就可以使用本地版本的Webpack
- //进入项目目录
- //确定已有package.json,没有就npm init 创建
- $ npm install webpack --save-dev
- //查看webpack 版本信息
- $ npm info webpack
- //安装指定版本
- $ npm install webpack@1.31.x --save-dev
-
如果要使用Webpack开发工具,要单独安装 webpack-dev-server
$ npm install webpack-dev-server --save-dev
在线阅读
W3Cshool https://www.w3cschool.cn/webpack_doc
相关下载地址
下载nodeJS NodeJS官方网站