From ff3e12e5d398f653b2d0ea182a1fc963473d47f6 Mon Sep 17 00:00:00 2001 From: Miguel Espinoza Date: Sun, 12 Jul 2020 22:26:56 +0200 Subject: [PATCH] Update installation.md (#2608) [skip ci] Co-authored-by: Isiah Meadows --- docs/installation.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/installation.md b/docs/installation.md index 00f1745f..07fd5f73 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -81,6 +81,15 @@ $ npm start 7. open `index.html` in a browser +Optionally, you can include Mithril as a global variable using Webpack's provide plugin, to avoid including `import m from "mithril"` across a large number of files: +```js +plugins: [ + new webpack.ProvidePlugin({m: "mithril"}), + // ... +] +``` +Then, you could remove the import line from step 4 (don't forget to restart Webpack if you ran it with `--watch`), and it will work just the same. + #### Step by step For production-level projects, the recommended way of installing Mithril is to use npm.