Skip to content

Commit a60db14

Browse files
j-wenningmilesfrain
authored andcommitted
Update "Calling PureScript from JavaScript" Section
Updated information regarding Spago's JS bundling functionality.
1 parent b595810 commit a60db14

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

text/chapter10.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,12 +1118,7 @@ Test.gcd(15)(20);
11181118

11191119
Here, I am assuming that the code was compiled with `spago build`, which compiles PureScript modules to ES modules. For that reason, I was able to reference the `gcd` function on the `Test` object, after importing the `Test` module using `import`.
11201120

1121-
You might also like to bundle JavaScript code for the browser, using `spago bundle-app --to file.js`. In that case, you would access the `Test` module from the global PureScript namespace, which defaults to `PS`:
1122-
1123-
```javascript
1124-
var Test = PS.Test;
1125-
Test.gcd(15)(20);
1126-
```
1121+
You can also use the `spago bundle-app` and `spago bundle-module` commands to bundle your generated JavaScript into a single file. Consult [the documentation](https://github.com/purescript/spago#bundle-a-project-into-a-single-js-file) for more information.
11271122

11281123
### Understanding Name Generation
11291124

0 commit comments

Comments
 (0)