Update webpack guide with npm init
This commit is contained in:
parent
498569cee4
commit
09836f69db
|
@ -34,18 +34,29 @@ Now you need to configure webpack. The plugin expects a webpack project in the
|
||||||
|
|
||||||
### `package.json`
|
### `package.json`
|
||||||
|
|
||||||
This file instructs `npm` which packages we will need. All we need for a
|
This file instructs `npm` which packages we will need.
|
||||||
start is to create an almost empty file:
|
|
||||||
|
|
||||||
Recent versions of `npm` require `name` and `version` fields in your
|
[npm-init :ext](https://docs.npmjs.com/cli/init) is a command-line tool to
|
||||||
`package.json` (see [npm package.json docs
|
interactively create a ``package.json`` file.
|
||||||
:ext](https://docs.npmjs.com/files/package.json)).
|
|
||||||
|
```
|
||||||
|
$ npm init
|
||||||
|
```
|
||||||
|
|
||||||
|
This will ask you a bunch of questions (invoke with ``--yes`` to use default
|
||||||
|
values) and then generate the file for you:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"name": "foobar",
|
"name": "lektor-example",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue