|
3 | 3 | <img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
|
4 | 4 | </a>
|
5 | 5 | </div>
|
| 6 | +<p align="center"> |
| 7 | + A scaffolding tool for webpack. |
| 8 | +</p> |
6 | 9 | <br>
|
7 | 10 |
|
8 | 11 | [](https://www.npmjs.com/package/webpack-cli)
|
|
16 | 19 |
|
17 | 20 | # Webpack CLI
|
18 | 21 |
|
19 |
| -Webpack CLI encapsulates all code related to CLI handling. It captures options and sends them to webpack compiler. You can also find functionality for initializing a project and migrating between versions. |
| 22 | +* [About](#about) |
| 23 | +* [Getting Started](#getting-started) |
| 24 | +* [How It Works](#how-it-works) |
| 25 | +* Commands |
| 26 | + - [`webpack-cli init`](./packages/init/README.md#webpack-cli-init) |
| 27 | + - [`webpack-cli add`](./packages/add/README.md#webpack-cli-add) |
| 28 | + - [`webpack-cli info`](./packages/info/README.md#webpack-cli-info) |
| 29 | + - [`webpack-cli migrate`](./packages/migrate/README.md#webpack-cli-migrate) |
| 30 | + - [`webpack-cli remove`](./packages/remove/README.md#webpack-cli-remove) |
| 31 | + - [`webpack-cli generate-plugin`](./packages/generate-plugin/README.md#webpack-cli-generate-plugin) |
| 32 | + - [`webpack-cli generate-loader`](./packages/generate-loader/README.md#webpack-cli-generate-loader) |
| 33 | + - [`webpack-cli serve`](./packages/serve/README.md#webpack-cli-serve) |
| 34 | + - [`webpack-cli update`](./packages/update/README.md#webpack-cli-update) |
| 35 | +* [webpack.config.js](https://webpack.js.org/concepts/configuration/) |
| 36 | +* [Contributing and Internal Documentation](#contributing-and-internal-documentation) |
20 | 37 |
|
21 |
| -## Migration from webpack v1 to v2 |
| 38 | +## About |
22 | 39 |
|
23 |
| -The `migrate` feature eases the transition from [version 1](http://webpack.github.io/docs/) to [version 2](https://gist.github.com/sokra/27b24881210b56bbaff7). `migrate` also allows users to switch to the new version of webpack without having to extensively [refactor](https://webpack.js.org/guides/migrating/). |
| 40 | +Webpack CLI is a CLI tool for providing a flexible set of commands for developers to increase speed when setting up a custom webpack project. As of webpack v4, webpack is not expecting a configuration file but in many cases, developers want to create a more custom webpack configuration based on their use-cases and needs. Exactly all of these cases with webpack CLI we are providing a set of tools so improve the setup of custom webpack configuration. |
24 | 41 |
|
25 |
| -`webpack-cli migrate <config>` |
| 42 | +### How to install |
26 | 43 |
|
27 |
| -[Read more about migrating](MIGRATE.md) |
| 44 | +When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed! |
28 | 45 |
|
29 |
| -## Creating new webpack projects |
| 46 | +Otherwise `npm install --save-dev webpack-cli` will install it. |
30 | 47 |
|
31 |
| -The `init` feature allows users to get started with webpack, fast. Through scaffolding, people can create their own configuration in order to faster initialize new projects for various of use cases. |
| 48 | +### Commands |
32 | 49 |
|
33 |
| -`webpack-cli init webpack-scaffold-<package>` |
| 50 | +In order to simplify many common tasks when using webpack in your projects, webpack CLI provides different commands according to their use-cases. |
34 | 51 |
|
35 |
| -[Read more about scaffolding](SCAFFOLDING.md) |
| 52 | +webpack CLI is organized as a [multi-package repository](https://github.com/lerna/lerna) and every command is developed in the `packages` Folder. |
| 53 | + |
| 54 | +## Getting started |
| 55 | + |
| 56 | +When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed! Otherwise you would need to install webpack CLI and the packages you want to use. If we want to use the `init` functionality to create a new `webpack.config.js` configuration file: |
| 57 | + |
| 58 | +```sh |
| 59 | +npm i webpack-cli @webpack-cli/init |
| 60 | +npx webpack-cli init |
| 61 | +``` |
| 62 | + |
| 63 | +After asking multiple questions related to your project and as a result create a webpack.config.js based on your selected answers. |
| 64 | + |
| 65 | +## How it works |
| 66 | + |
| 67 | +With v3 of webpack CLI we introduced a scaffolding as an integral part of it. The idea is that creating complex webpack configuration for different use-cases can be difficult and we want to make it easy for everyone to be able to create and share their solutions. For this purpose `webpack-scaffold` was created. It is a utility suite for creating these addons. It contains functions that could be of use for creating an addon yourself. |
| 68 | + |
| 69 | +For a much more comprehensive guide, we recommend reading our [Scaffolding](./SCAFFOLDING.md) documentation or checkout the example project [How do I compose a webpack-addon?](https://github.com/ev1stensberg/webpack-addons-demo). |
36 | 70 |
|
37 | 71 | ## Contributing and Internal Documentation
|
38 | 72 |
|
39 |
| -The webpack family welcomes any contributor, small or big. We are happy to elaborate, guide you through the source code and find issues you might want to work on! To get started have a look at our [documentation on contributing](CONTRIBUTING.md), or our [Internal Documentation](https://webpack.github.io/webpack-cli/) |
| 73 | +The webpack family welcomes any contributor, small or big. We are happy to elaborate, guide you through the source code and find issues you might want to work on! To get started have a look at our [documentation on contributing](CONTRIBUTING.md). |
40 | 74 |
|
0 commit comments