Skip to content

Merge the two installation guides into one #766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 4 additions & 4 deletions content/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ 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
npm init -y
npm install --save-dev webpack@beta
npm install --save-dev webpack
./node_modules/.bin/webpack --help # Shows a list of valid cli commands
.\node_modules\.bin\webpack --help # For windows users
```
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.

27 changes: 17 additions & 10 deletions content/guides/installation.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
---
title: Installation
sort: 1
contributors:
- pksjce
- bebraw
- simon04
sort: 1
---

### Pre-requisites

We assume you have `node` and `npm` already installed.

### Global Installation

``` bash
npm install webpack -g
```
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.

The `webpack` command is now available globally.
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).

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

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 -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