Module type is important. One of the biggest things to realizing about developing in javascript with tiddlywiki is how to call other "libraries". For example, in order to call the "json-pointer" library, I created a tiddler the following metadata & the library in the text field (actually a seperate *.js.meta file next to the lib a I'm serving node-js style, but they are equivalent).
module-type: library
tags:
title: $:/plugins/joshuafontany/jsonmangler/modules/libs/json-pointer.js
type: application/javascript
Then, in order to reference it in other widget/filter/etc script tiddlers, you do:
var pointer = require("$:/plugins/joshuafontany/jsonmangler/modules/libs/json-pointer.js");
I can then access the various "exports" by calling `pointer.whatever()`, etc, etc.
Best,
Joshua F