You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Should be, yes. I believe it looks in a 'modules' directory for any modules.


    $ cat modules/bar.js 
    exports = 42;
    $ cat foo.js 
    var a = require("bar");
    $ espruino -d Pixl foo.js
    # writes it to RAM
    $ espruino -d Pixl --minify foo.js
    # writes it to RAM with minification
    $ espruino -d Pixl --minify --config MODULE_AS_FUNCTION=true --config SAVE_ON_SEND=1 foo.js
    # writes to flash with minified code

    You may also have some success with --config PRETOKENISE=true, which will pretokenise code before upload, saving a bit of flash


Avatar for Gordon @Gordon started