-
-
Save ivanoats/4e21f820fdc35e11b5c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-contrib-clean'); | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-jscs'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-karma'); | |
grunt.loadNpmTasks('grunt-browserify'); | |
grunt.loadNpmTasks('grunt-hapi'); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
project: { | |
app: ['app'], | |
scss: ['<%= project.app %>/sass/style.scss'], | |
css: ['<%= project.app %>/css/**/*.css'], | |
alljs: ['<%= project.app %>/js/**/*.js'] | |
}, | |
wiredep: { | |
task: { | |
src: [ | |
'<%= project.app %>/*.html', | |
'<%= project.app %>/sass/style.scss' | |
] | |
} | |
}, | |
clean: { | |
dev: { | |
src: ['build/'] | |
} | |
}, | |
copy: { | |
dev: { | |
expand: true, | |
cwd: 'app/', | |
src: ['*.html', '<%= project.css %>', '<%= project.app %>/css/*.css.map'], | |
dest: 'build/', | |
filter: 'isFile' | |
} | |
}, | |
jshint: { | |
all: ['<%= project.alljs %>', 'Gruntfile.js', 'server.js'], | |
options: { | |
jshintrc: true | |
} | |
}, | |
jscs: { | |
src: ['<%= project.alljs %>', 'server.js', 'Gruntfile.js'], | |
options: { | |
config: '.jscsrc' | |
} | |
}, | |
browserify: { | |
dev: { | |
options: { | |
debug: true | |
}, | |
src: ['<%= project.alljs %>'], | |
dest: 'build/js/app.js' | |
} | |
}, | |
karma: { | |
unit: { | |
configFile: 'karma.conf.js' | |
}, | |
continuous: { | |
configFile: 'karma.conf.js', | |
singleRun: true, | |
browsers: ['PhantomJS'] | |
} | |
}, | |
sass: { | |
dev: { | |
options: { | |
style: 'expanded', | |
compass: false | |
}, | |
files: { | |
'build/css/style.css':'<%= project.scss %>' | |
} | |
} | |
}, | |
hapi: { | |
development: { | |
options: { | |
server: require('path').resolve('./server'), | |
bases: { | |
'/': require('path').resolve('./build/') | |
} | |
} | |
} | |
}, | |
watch: { | |
sass: { | |
files: '<%= project.app %>/sass/{,*/}*.{scss,sass}', | |
tasks: ['build'] | |
}, | |
test: { | |
files: ['<%= project.alljs %>', 'test/front-end/**/*.js'], | |
tasks: ['build:dev', 'karma:unit'] | |
} | |
} | |
}); //end initConfig | |
grunt.registerTask('build', ['clean:dev', 'sass:dev', 'copy:dev']); | |
grunt.registerTask('test', ['build:dev', 'karma:continuous']); | |
grunt.registerTask('default', ['test', 'watch']); | |
grunt.registerTask('serve', ['build:dev', 'hapi', 'watch']); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ivan ~ dev scholarships tree app/css app/css | |
├── dropdowns.css | |
├── full.css | |
├── ie.css | |
├── mini-search.css | |
├── mini.css | |
├── radios.css | |
├── search.css | |
└── structure.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ivan ~ dev scholarships tree build develop | |
│build | |
. │├── css | |
││ ├── style.css | |
││ └── style.css.map | |
│├── header-mini-search.html | |
│├── header-mini.html | |
│└── index.html | |
│ | |
│1 directory, 5 files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment