From cf46a09678dc9d4d6d30466bd43fd99abdae2562 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 29 Jan 2017 23:12:15 +0100 Subject: [PATCH 1/2] Merge the two installation guides into one --- content/api/cli.md | 2 +- content/get-started/index.md | 6 +-- content/get-started/install-webpack.md | 55 -------------------------- content/guides/installation.md | 29 ++++++++------ 4 files changed, 22 insertions(+), 70 deletions(-) delete mode 100644 content/get-started/install-webpack.md diff --git a/content/api/cli.md b/content/api/cli.md index 59c510bac7fd..5385079e0dff 100644 --- a/content/api/cli.md +++ b/content/api/cli.md @@ -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) diff --git a/content/get-started/index.md b/content/get-started/index.md index 6ff150c0320a..602bea0902e6 100644 --- a/content/get-started/index.md +++ b/content/get-started/index.md @@ -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 @@ -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'. diff --git a/content/get-started/install-webpack.md b/content/get-started/install-webpack.md deleted file mode 100644 index a53de6973a37..000000000000 --- a/content/get-started/install-webpack.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Installation -contributors: - - pksjce - - bebraw -sort: 1 ---- - -### Pre-requisites - -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. - -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). - -The next section tells you how to install webpack locally in a project. - -### Local Installation - -``` bash -npm install webpack@beta --save-dev - -npm install webpack@ --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. - -```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` - - -### 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 - -``` bash -npm install webpack/webpack# -``` diff --git a/content/guides/installation.md b/content/guides/installation.md index e2eebcedc321..98488a6f0ddf 100644 --- a/content/guides/installation.md +++ b/content/guides/installation.md @@ -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@ --save-dev ``` @@ -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 From 6033cf95a6a224e212c25a68d7b8a6c14087a925 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Tue, 31 Jan 2017 10:55:08 +0100 Subject: [PATCH 2/2] No need for `webpack@beta` anymore --- content/get-started/index.md | 2 +- content/guides/installation.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/get-started/index.md b/content/get-started/index.md index 602bea0902e6..9ba9f955ba7a 100644 --- a/content/get-started/index.md +++ b/content/get-started/index.md @@ -20,7 +20,7 @@ Create a demo directory to try out webpack. [Install webpack](/guides/installati ```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 ``` diff --git a/content/guides/installation.md b/content/guides/installation.md index 98488a6f0ddf..a685b2d801b0 100644 --- a/content/guides/installation.md +++ b/content/guides/installation.md @@ -18,7 +18,7 @@ The next section tells you how to install webpack locally in a project. ### Local Installation ``` bash -npm install webpack@beta --save-dev +npm install webpack --save-dev npm install webpack@ --save-dev ``` @@ -41,7 +41,7 @@ T> To run the local installation of webpack you can access its bin version as `n 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 +npm install webpack -g ``` The `webpack` command is now available globally.