-
Why can't you use the
espruino
npm module directly to send your code? Or is there some reason you need to get into the REPL afterwards?Anyway, I'm actually making a Rollup plugin for Espruino. I hadn't thought of using Rollup for bundling Espruino projects before, but it makes perfect sense. It prefers ES modules (
import … from
,export default
, etc), supports treeshaking, has a nice selection of plugins and produces no overhead as long asformat
ises
(the default). For simple Espruino projects without any external dependencies it results in very nice code (before uglification of course). The result is a flattening of all your modules (treeshaken) into one file (one scope) without any wrappers/loaders.https://github.com/joakimstai/rollup-plugin-espruino
Note: I haven't actually tested it with an Espruino device yet, as I haven't got one on me :)
Hi @Gordon. Execution from the command-line works fine. I'm working with the espruino module as an import in my build script: https://github.com/stokebrain/morra-espruino1/blob/master/build.js
The trouble starts with
Espruino.Core.Serial.open()
inopenConnection()
.