Skip to content
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

fix(init): fix the invalid package name #1228

Merged
merged 2 commits into from
Feb 16, 2020
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
12 changes: 6 additions & 6 deletions INIT.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# webpack-cli create
# webpack-cli init

`webpack-cli create` is used to initialize `webpack` projects quickly by scaffolding configuration and creating a runnable project with all the dependencies based on the user preferences.
`webpack-cli init` is used to initialize `webpack` projects quickly by scaffolding configuration and creating a runnable project with all the dependencies based on the user preferences.

## Initial Setup

### a. Local setup

These are the steps necessary to setup `webpack-cli create` locally:
These are the steps necessary to setup `webpack-cli init` locally:

1. Create `package.json` through npm

Expand All @@ -28,7 +28,7 @@ These are the steps necessary to setup `webpack-cli create` locally:

### b. Global Setup

These are the steps necessary to setup `webpack-cli create` globally:
These are the steps necessary to setup `webpack-cli init` globally:

1. Install `webpack` and `webpack-cli` globally

Expand All @@ -47,13 +47,13 @@ These are the steps necessary to setup `webpack-cli create` globally:
### a. Running locally

```shell
npx webpack-cli create
npx webpack-cli init
```

### b. Running globally

```shell
webpack-cli create
webpack-cli init
```

### Description of questions asked by generator
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ The project also has several utility packages which are used by other commands

## Getting started

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 `create` command to create a new `webpack.config.js` configuration file:
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` command to create a new `webpack.config.js` configuration file:

```sh
npm i webpack-cli @webpack-cli/init
npx webpack-cli create
```

You will be prompted for some questions about what how you want to generate your config file when running the `create` command so webpack CLI can provide the best fitting configuration.
You will be prompted for some questions about what how you want to generate your config file when running the `init` command so webpack CLI can provide the best fitting configuration.

## webpack CLI Scaffolds

Expand Down
2 changes: 1 addition & 1 deletion lib/webpack-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { groups } = require('./utils/cli-flags');
const webpackMerge = require('webpack-merge');

const defaultCommands = {
create: 'init',
init: 'init',
loader: 'generate-loader',
plugin: 'generate-plugin',
info: 'info',
Expand Down
2 changes: 1 addition & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This folder is the collection of those packages.
2. [generate-plugin](https://github.com/webpack/webpack-cli/tree/master/packages/generate-plugin)
3. [generators](https://github.com/webpack/webpack-cli/tree/master/packages/generators)
4. [info](https://github.com/webpack/webpack-cli/tree/master/packages/info)
5. [create](https://github.com/webpack/webpack-cli/tree/master/packages/init)
5. [init](https://github.com/webpack/webpack-cli/tree/master/packages/init)
6. [migrate](https://github.com/webpack/webpack-cli/tree/master/packages/migrate)
7. [serve](https://github.com/webpack/webpack-cli/tree/master/packages/serve)
8. [utils](https://github.com/webpack/webpack-cli/tree/master/packages/utils)
Expand Down