Show
Destroy
An entry
Get it down. Make it good. Share it.
Title
Text
Here's the punchline: `browserify dist/typescript-npm-package.umd.js --standalone JungleBus > js/jungle_bus.js` Here's the story: I wanted to use JungleBus in an Elixir app to listen for events from the bitcoin (BSV) blockchain. The current version of Elixir uses `esbuild`, as opposed to `npm` for package management. And when I went to `import` the JungleBus functions in `app.js`, I got a variety of errors that lead me to start digging. Errors like `import_js_jungle_bus` is not a constructor, and `require is not defined` for centrifuge, a dependent library of JungleBus. I found my way to Browserify, and tried a few different commands that did not work, including: `browserify dist/typescript-npm-package.umd.js -o --standalone js/jungle_bus.js` And I tried referencing the generated `jungle_bus.js` as an import in `app.js` as well as linking to it as a `type=module` next to other apps in `root.html.leex`, but no luck. Ultimately, I found the `--standalone` option, and was able to run: `browserify dist/typescript-npm-package.umd.js --standalone JungleBus > js/jungle_bus.js` to generate file I was able to reference in `app.js` and got the `import`s to work... finally. 😅
Status
idea
draft
release
personal
Series
Part of a Series?
Bitcoin
On Work
Phoenix Trello Tutorial
Civics
Re Email Address
Tags
javascript
×
elixir
×
esbuild
×
jungle bus
×
×
+
Slug
Url
Image 1
Image 2
Image 3
Visible
Date