1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Add all externals, actually mention ^ range

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-05-10 08:14:11 -04:00
parent d8babce9e7
commit 3417d591dc

View File

@ -43,8 +43,8 @@ Some of the most-important fields include:
- `main`: the extension's entry point run in `main` process. - `main`: the extension's entry point run in `main` process.
- `renderer`: the extension's entry point run in `renderer` process. - `renderer`: the extension's entry point run in `renderer` process.
- `engines.lens`: the minimum version of Lens API that the extension depends upon. - `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. 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. Meaning that `^5.4` and `5.4` both mean the same thing, and the patch version in `5.4.2` is ignored.
```javascript ```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). 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": [ "externals": [
... ...
{ {
"mobx": "var global.Mobx" "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 ## Extension Entry Files