MagicMirror² v2.7.0 is available! For more information about this release, check out this topic.

Module programming preview, jsfiddle?


  • Moderator

    @washichi Interesting idea for the module. And glancing at your code you seem to be on the right track.

    I may be not understanding what you trying Sublime Text to do. It’s just a text editor with ability to add various packages on top of it. It’s not a full blown IDE. I don’t believe that you can compile or preview the JavaScript module directly in Sublime.

    My general workflow for module creation is something like this:

    1. Create MMM-mymodule directory inside MagicMirror/modules
    2. Open MagicMirror directory in sublime
    3. Add barebones config for the module to modules array in config.js, for example:
    {
    	module: "MMM-mymodule",
    	position: "bottom_right",
    	config : {
    		
    	}
    },
    
    1. Start node serveronly and point my Chrome with dev tools open to the http://localhost:8080
    2. Create/edit MagicMirror/modules/MMM-mymodule/MMM-mymodule.js, save it. (or other files that you need for the module)
    3. Refresh the browser to pickup my changes, debug etc.
    4. Repeat steps 5-6 as I go along. If adding/editing node_helper.js repeat steps 4-6 since node needs to pickup that file.

    Some of restarts/refreshes can be automated on file save with different tools, but I’m not going to get into that right now.