Skip to content

Commit 36d0161

Browse files
committed
Document loading FEAScript from a script tag
The UMD build, loaded with a classic <script> tag, defines the global FEAScript with every export, and its FEAScriptWorker finds the worker file next to the bundle (FEAScript-core 9b281dd, tested by tests/umd/umd.test.html). The installation page did not mention it. Signed-off-by: Nikos Chamakos <nikoscham@gmail.com>
1 parent 90013e8 commit 36d0161

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎docs/getting-started/installation.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ Both URLs above always serve the latest FEAScript release, so your page updates
3434

3535
You can also download a release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases) and import it locally.
3636

37+
### With a script tag
38+
39+
Pages that do not use ES modules can load the UMD build with a classic `<script>` tag. It defines a global
40+
`FEAScript` object that holds every export:
41+
42+
```html
43+
<script src="https://core.feascript.com/dist/feascript.umd.js"></script>
44+
<script>
45+
const { FEAScriptModel, plotSolution } = FEAScript;
46+
</script>
47+
```
48+
49+
`FEAScriptWorker` works with this build too: it loads `feascript-worker.esm.js` from the same folder as
50+
`feascript.umd.js`, so keep the files of `dist/` together when you host the library yourself.
51+
3752
## With Node.js
3853

3954
```bash

0 commit comments

Comments
 (0)