From 09836f69db0aef5908f55233ed50e3d317476c17 Mon Sep 17 00:00:00 2001 From: Raphael Pierzina Date: Tue, 21 Feb 2017 22:14:31 +0000 Subject: [PATCH] Update webpack guide with npm init --- content/docs/guides/webpack/contents.lr | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/content/docs/guides/webpack/contents.lr b/content/docs/guides/webpack/contents.lr index fe5d62ba..04815825 100644 --- a/content/docs/guides/webpack/contents.lr +++ b/content/docs/guides/webpack/contents.lr @@ -34,18 +34,29 @@ Now you need to configure webpack. The plugin expects a webpack project in the ### `package.json` -This file instructs `npm` which packages we will need. All we need for a -start is to create an almost empty file: +This file instructs `npm` which packages we will need. -Recent versions of `npm` require `name` and `version` fields in your -`package.json` (see [npm package.json docs -:ext](https://docs.npmjs.com/files/package.json)). +[npm-init :ext](https://docs.npmjs.com/cli/init) is a command-line tool to +interactively create a ``package.json`` file. + +``` +$ 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 { - "name": "foobar", + "name": "lektor-example", "version": "0.1.0", - "private": true + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "MIT" } ```