Skip to content

Commit

Permalink
Merge pull request webpack#36 from dear-lizhihua/cn
Browse files Browse the repository at this point in the history
安装 webpack
  • Loading branch information
dear-lizhihua authored Dec 23, 2016
2 parents 01a91bf + 1c4eeab commit 84594e1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions content/get-started/install-webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@ sort: 1

### 预备知识

Before getting started, make sure you have a fresh version of [Node.js](https://nodejs.org/en/) installed. The current LTS is an ideal starting point. You may run into a variety of issues with the older versions as they may be missing functionality webpack or related packages might need.
在开始前,先要确认你已经安装 [Node.js](https://nodejs.org/en/) 的最新版本。使用最新的 LTS 是理想的版本。使用旧版本,你可能遇到各种问题,因为它们可能缺少 webpack 功能或缺少相关 package 包。

### Global Installation
### 全局安装

``` bash
npm install webpack -g
```

The `webpack` command is now available globally.
现在可以在全局使用 `webpack` 命令了。

However, this is not a recommended practice. This locks you down to a specific version of webpack and might fail in projects that use a different version. The next section tells you how to install webpack locally in a project.
然而,这并不是推荐用法。这会将你的 webpack 锁定到特定版本,并且可能在使用 webpack 不同版本的项目中失败。接下来的章节向你介绍如何在项目中本地安装 webpack。

### Local Installation
### 本地安装

``` bash
npm install webpack --save-dev

npm install webpack@<version> --save-dev
```

If you are using npm scripts in your project, npm will try to look for webpack installation in your local modules for which this installation technique is useful.
如果你在项目中使用了 npm scriptsnpm 会尝试在本地模块中查找安装的 webpack,这种本地安装的方式有助于查找本地的 webpack。

```json
"scripts": {
"start": "webpack --config mywebpack.config.js"
}
```

This is standard and recommended practice.
这是标准和推荐的用法。

T> To run the local installation of webpack you can access its bin version as `node_modules/.bin/webpack`
T> 要运行本地安装的 webpack,你可以访问其 bin 版本为 `node_modules/.bin/webpack`


### Bleeding Edge
### 前沿领域

If you are enthusiastic about using the latest that webpack has to offer (beware - may be unstable), you can install directly from the webpack repository using
如果你热衷于使用 webpack 提供的最新版本(当心 - 可能不稳定),你可以直接从 webpack 仓库中安装

``` bash
npm install webpack/webpack#<tagname/branchname>
Expand Down

0 comments on commit 84594e1

Please sign in to comment.