You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 22, 2019. It is now read-only.
webpack is now installed globally and the webpack command is available.
这样,webpack 将被安装为全局工具,同时,也提供了一个 webpack 的命令。
Use webpack in a project
在项目中使用 webpack
It's best to have webpack as a dependency in your project. Through this you can choose a local webpack version and will not be forced to use the single global one.
Add a package.json configuration file for npm with:
通过 npm 来增加一个 package.json 文件:
$ npm init
The answers to the questions are not so important if you don't want to publish your project to npm.
[上面这一句可能是从SO复制过来的,所以对此话题貌似无意义]
Install and add webpack to the package.json with:
用下面的命令安装 webpack 并将其添加到 packeage.json 中:
$ npm install webpack --save-dev
Versions
版本
There are two versions of webpack available. The stable one and a beta version. The beta version is marked with a -beta in the version string. The beta version may contain fragile changes or experimental features and is less tested. See changelog for differences. For serious stuff you should use the stable version: