A recently developed module is now available for intercepting and compiling Jade protocols automatically. Simply add this module to your main file with the following code:
'use strict';
var app = require('app');
var locals = {/* ...*/};
var j = require('electron-jade')({pretty: true}, locals);
var BrowserWindow = require('browser-window');
// Standard stuff
app.on('ready', function () {
mainWindow = new BrowserWindow({ width: 800, height: 600 });
mainWindow.loadUrl('jade://' + __dirname + '/index.jade');
// continue with the rest...
});
Note that instead of using file://
, you will now use jade://
.
Please Note: This module is still in the early stages of development and may not be fully optimized.
UPDATE:
The package has been officially released on npm: https://www.npmjs.com/package/electron-jade