Skip to content

Commit

Permalink
Merge the two installation guides into one
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Jan 29, 2017
1 parent 4d3f4fc commit cf46a09
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 70 deletions.
2 changes: 1 addition & 1 deletion content/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For proper usage and easy distribution of this configuration, webpack can be con

## Installation

Have a look at [this page](/get-started/install-webpack)
Have a look at [this page](/guides/installation)

?> The new CLI for webpack is under development. New features are being added such as the `--init` flag. [Check it out!](https://github.com/webpack/webpack-cli)

Expand Down
6 changes: 3 additions & 3 deletions content/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ contributors:
- simon04
---

webpack is a tool to build JavaScript modules in your application. To start using `webpack` from its [cli](/api/cli) or [api](/api/node), follow the [Installation instructions](/get-started/install-webpack).
webpack is a tool to build JavaScript modules in your application. To start using `webpack` from its [cli](/api/cli) or [api](/api/node), follow the [Installation instructions](/guides/installation).
webpack simplifies your workflow by quickly constructing a dependency graph of your application and bundling them in the right order. webpack can be configured to customise optimisations to your code, to split vendor/css/js code for production, run a development server that hot-reloads your code without page refresh and many such cool features. Learn more about [why you should use webpack](/get-started/why-webpack).

## Creating a bundle

Create a demo directory to try out webpack. [Install webpack](/get-started/install-webpack).
Create a demo directory to try out webpack. [Install webpack](/guides/installation).

```bash
mkdir webpack-demo && cd webpack-demo
Expand Down Expand Up @@ -117,7 +117,7 @@ index.js 1.56 kB 0 [emitted] main
```
T> Output may vary. If the build is successful then you are good to go.

T> If you [installed webpack globally](/get-started/install-webpack#global-installation), you have to invoke webpack using `webpack`.
T> If you [installed webpack globally](/guides/installation#global-installation), you have to invoke webpack using `webpack`.

Open `index.html` in your browser to see the result of a successful bundle.
You should see a page with the following text: 'Hello webpack'.
Expand Down
55 changes: 0 additions & 55 deletions content/get-started/install-webpack.md

This file was deleted.

29 changes: 18 additions & 11 deletions content/guides/installation.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
---
title: Installation
sort: 1
contributors:
- pksjce
- bebraw
- simon04
sort: 1
---

### Pre-requisites

We assume you have `node` and `npm` already installed.
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.

### Global Installation
Note that this documentation is for webpack 2, for which there is not yet a stable release. You can get the most recent beta by installing with the `beta` tag (see below).

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

The `webpack` command is now available globally.

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.
The next section tells you how to install webpack locally in a project.

### Local Installation

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

npm install webpack@<version> --save-dev
```
Expand All @@ -40,6 +36,17 @@ 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`


### Global Installation

W> Note that a global webpack installation 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.

``` bash
npm install webpack@beta -g
```

The `webpack` command is now available globally.


### 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
Expand Down

0 comments on commit cf46a09

Please sign in to comment.