Skip to content

Instantly share code, notes, and snippets.

@1N50MN14
Created July 22, 2013 23:57
Show Gist options
  • Save 1N50MN14/6058736 to your computer and use it in GitHub Desktop.
Save 1N50MN14/6058736 to your computer and use it in GitHub Desktop.
Complete livereload example
var unreal = require('unrealjs'),
host = unreal.isProduction ? '55.55.55.55' : '127.0.0.1',
port = unreal.isProduction ? 8888 : 9999
var services = unreal.serviceRegistry.connect(host, port)
var config = {
views: { //must always contain a layout file (either .html or .jade)
paths: ['views/'],
options: {},
locals: {}
},
styles: {
engine: 'less', // 'less' or 'stylus'
filename: 'styles/styles.less', //main stylesheet
paths: ['styles/', 'styles/imports/'], //import folders
minify: false,
output: 'gen/app.css'
},
js: {
client: 'app/',
commonjs: [], // array of node modules to make requirable client-side
shim: [], //non node module to shim and make requireable client-side
minify: false,
output: 'gen/app.js'
},
http: {
static: 'public/',
port: 3000,
ssl: {
enabled: false,
key: 'sslcert/server.key',
cert: 'sslcert/server.crt'
}
},
webinstance: { //webinstance meta for livereload to connect to
role: 'web',
version: '0.0.1'
}
}
var livereload = new unreal.LiveReload(services, config, unreal.router)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment