Skip to content

Commit

Permalink
updated grunt to use browsersync, added bundler Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jez500 committed Mar 8, 2014
1 parent 9bca6c9 commit edf9c0c
Show file tree
Hide file tree
Showing 10 changed files with 803 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
src/theme/.sass-cache
/vendor
/node_modules

.bundle/
Gemfile.lock
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Pull gems from RubyGems.
source 'https://rubygems.org'

gem 'sass', "3.3.0.rc.2"
gem 'compass', "1.0.0.alpha.17"
gem "compass-core", "1.0.0.alpha.16"
gem 'breakpoint', "2.4.1"
gem 'singularitygs', "1.2.0.rc.6"
67 changes: 48 additions & 19 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = function(grunt) {
// Sass base
var sassPath = 'src/theme',
jsPath = 'src',
appPath = jsPath + '/js';

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
Expand All @@ -10,40 +14,40 @@ module.exports = function(grunt) {
src: [

// jQuery
'src/lib/required/jquery-1.10.2.js',
jsPath + '/lib/required/jquery-1.10.2.js',

// underscore
'src/lib/required/underscore-min.js',
jsPath + '/lib/required/underscore-min.js',

// backbone
'src/lib/required/backbone.dev.js',
'src/lib/required/backbone.rpc.min.js',
jsPath + '/lib/required/backbone.dev.js',
jsPath + '/lib/required/backbone.rpc.min.js',

// All our enabled js
'src/lib/enabled/*.js',
jsPath + '/lib/enabled/*.js',

// application js
'src/js/utils.js',
'src/js/app.js',
appPath + '/utils.js',
appPath + '/app.js',

// helpers
'src/js/helpers/*.js',
appPath + '/helpers/*.js',

// application models
'src/js/models/*.js',
appPath + '/models/*.js',

// application controllers
'src/js/controllers/*.js',
appPath + '/controllers/*.js',

// application collections - need to be loaded in order
'src/js/collections/xbmc.js',
'src/js/collections/video.js',
'src/js/collections/audio.js',
'src/js/collections/files.js',
appPath + '/collections/xbmc.js',
appPath + '/collections/video.js',
appPath + '/collections/audio.js',
appPath + '/collections/files.js',


// application views
'src/js/views/*.js'
appPath + '/views/*.js'

],
dest: 'dist/<%= pkg.name %>.js'
Expand All @@ -60,7 +64,7 @@ module.exports = function(grunt) {
}
},
jshint: {
files: ['Gruntfile.js', 'src/js/*.js', 'src/js/*/*.js'],
files: ['Gruntfile.js', appPath + '/*.js', appPath + '/*/*.js'],
options: {
// options here to override JSHint defaults
globals: {
Expand All @@ -71,19 +75,44 @@ module.exports = function(grunt) {
}
}
},
compass: {
dist: {
options: {
// The path Compass will run from.
basePath: sassPath
// To use with bundled gems, uncomment below
//, bundleExec: true
}
}
},
browser_sync: {
dev: {
bsFiles: {
src: 'dist/theme/css/**/*.css'
},
options: {
watchTask: true,
injectChanges: true
}
}
},

// Watch tasks
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
files: [sassPath + '/sass/**/*.scss', '<%= jshint.files %>'],
tasks: ['compass', 'jshint']
}
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-browser-sync');

grunt.registerTask('test', ['jshint']);

grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
grunt.registerTask('default', ['browser_sync', 'watch', 'jshint', 'concat', 'uglify']);

};
Loading

0 comments on commit edf9c0c

Please sign in to comment.