From be73c4f1e6b9bff40d9f8f063dd4e7c6d2e6360e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Mesquita?= Date: Wed, 19 Aug 2015 23:03:56 -0300 Subject: [PATCH] FS-8009 #resolve Create a grunt project with livereload support. From now on, use npm install && grunt serve to develop on this project. --- html5/verto/verto_communicator/Gruntfile.js | 60 +++++++++++++++++++++ html5/verto/verto_communicator/package.json | 11 ++++ 2 files changed, 71 insertions(+) create mode 100644 html5/verto/verto_communicator/Gruntfile.js create mode 100644 html5/verto/verto_communicator/package.json diff --git a/html5/verto/verto_communicator/Gruntfile.js b/html5/verto/verto_communicator/Gruntfile.js new file mode 100644 index 0000000000..7eb7a9db3e --- /dev/null +++ b/html5/verto/verto_communicator/Gruntfile.js @@ -0,0 +1,60 @@ +/*jslint node: true */ +'use strict'; + +var pkg = require('./package.json'); + +module.exports = function (grunt) { + + // load all grunt tasks + require('load-grunt-tasks')(grunt); + + // Project configuration. + grunt.initConfig({ + watch: { + js: { + files: ['js/{,*/}*.js'], + tasks: ['newer:jshint:all'], + options: { + livereload: true + } + }, + gruntfile: { + files: ['Gruntfile.js'] + }, + livereload: { + options: { + livereload: true + }, + files: [ + 'partials/{,*/}*.html', + 'js/{,*/}*.js', + 'images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' + ] + } + }, + connect: { + options: { + port: 9001, + // Change this to '0.0.0.0' to access the server from outside. + hostname: 'localhost', + livereload: 35729 + }, + livereload: { + options: { + open: false, + middleware: function (connect) { + return [ + connect().use( + '/js/src', + connect.static('../js/src') + ), + connect.static('.') + ]; + } + } + }, + }, + }); + + grunt.registerTask('serve', ['connect:livereload', 'watch']); +}; diff --git a/html5/verto/verto_communicator/package.json b/html5/verto/verto_communicator/package.json new file mode 100644 index 0000000000..15db247928 --- /dev/null +++ b/html5/verto/verto_communicator/package.json @@ -0,0 +1,11 @@ +{ + "name": "verto_communicator", + "version": "0.0.1", + "devDependencies": { + "grunt": "~0.4.5", + "grunt-contrib-connect": "^0.9.0", + "grunt-contrib-jshint": "~0.10.0", + "grunt-contrib-watch": "^0.6.1", + "load-grunt-tasks": "^3.2.0" + } +}