Skip to content

Commit

Permalink
Use parcel instead of webpack for quickstart. (#2182)
Browse files Browse the repository at this point in the history
much simpler
  • Loading branch information
StephanHoyer authored and Barney Carroll committed Jun 13, 2018
1 parent 6dee157 commit 4de59e5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ $ npm install mithril --save

---

### Quick start with Webpack
### Quick start with [Parcel](https://parceljs.org/)

1. Initialize the directory as an npm package
```bash
$ npm init --yes
```

2. install required tools
2. Install the required tools.
```bash
$ npm install mithril --save
$ npm install webpack webpack-cli --save-dev
$ npm install parcel-bundler --save-dev
```

3. Add a "start" entry to the scripts section in `package.json`.
```js
{
// ...
"scripts": {
"start": "webpack src/index.js --output bin/app.js -d --watch"
"start": "parcel src/index.html"
}
}
```
Expand All @@ -52,20 +52,20 @@ import m from "mithril";
m.render(document.body, "hello world");
```

5. create `index.html`
5. Create `index.html`.
```html
<!DOCTYPE html>
<body>
<script src="bin/app.js"></script>
<script src="./index.js"></script>
</body>
```

6. run bundler
6. Run the bundler.
```bash
$ npm start
```

7. open `index.html` in a browser
7. Click the shown link to open it in the browser.

#### Step by step

Expand Down

0 comments on commit 4de59e5

Please sign in to comment.