• I've looked into loading Espruino modules straight from
    espruino.com/modules, and while that seems possible, I think It will
    have to wait untill I actually need is, I have enough on my plate as
    it is.

    If someone else wants to give it a shot, the relevant Rollup hooks
    appear to be resolveId and load.

    https://github.com/opichals/rollup-plugi­n-espruino-modules (not published to npm yet).

    It is generates a default config for Espruino which currently also does minification by default. It is just a first shot as it needs refinement with regards to configuration possibilities but it works quite nicely. It downloads the modules into the local ./modules folder

    I converted the webpack/babel example to use this and babel 7.x here https://github.com/opichals/espruino-rol­lup-babel-sample

    By using the import statements in the app code one can get use of tree shaking so that e.g. the SSD1306 driver's connectSPI is not bundled when not used.

    caveat: I haven't tried the resulting bundles on-board yet.

About

Avatar for opichals @opichals started