From 3417d591dcd21d7806e6c03d3e0c54c22f3b2f36 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 10 May 2022 08:14:11 -0400 Subject: [PATCH] Add all externals, actually mention ^ range Signed-off-by: Sebastian Malton --- docs/extensions/get-started/anatomy.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/extensions/get-started/anatomy.md b/docs/extensions/get-started/anatomy.md index 9591313f5e..481c18ac2c 100644 --- a/docs/extensions/get-started/anatomy.md +++ b/docs/extensions/get-started/anatomy.md @@ -43,8 +43,8 @@ Some of the most-important fields include: - `main`: the extension's entry point run in `main` process. - `renderer`: the extension's entry point run in `renderer` process. - `engines.lens`: the minimum version of Lens API that the extension depends upon. - We only support the `~` range, which is also optional to specify, and only major and minor version numbers. - Meaning that `~5.4` and `5.4` both mean the same thing, and the patch version in `5.4.2` is ignored. + We only support the `^` range, which is also optional to specify, and only major and minor version numbers. + Meaning that `^5.4` and `5.4` both mean the same thing, and the patch version in `5.4.2` is ignored. ```javascript { @@ -94,15 +94,23 @@ The following webpack `externals` are provided by `Lens` and must be used (when What is exported is the whole of the packages as a `*` import (within typescript). -For example, if you want to use `mobx` in your extension's main half (vs renderer half) you would add the following to your webpack configuration file: +For example, the following is how you would specify these within your webpack configuration files. -``` +```json +{ + ... "externals": [ ... { "mobx": "var global.Mobx" + "mobx-react": "var global.MobxReact" + "react": "var global.React" + "react-router": "var global.ReactRouter" + "react-router-dom": "var global.ReactRouterDom" + "react-dom": "var global.ReactDOM" } ] +} ``` ## Extension Entry Files