Skip to content

Instantly share code, notes, and snippets.

@joedaniels29
Created August 18, 2016 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joedaniels29/8a19f7fd78ea0ecba38712b3f5215695 to your computer and use it in GitHub Desktop.
Save joedaniels29/8a19f7fd78ea0ecba38712b3f5215695 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// configure the tasks
grunt.initConfig({
//pkg: grunt.file.readJSON('package.json'),
clean: {
all: ['Epilepsy/Resources/HTMLContent']
},
copy: {
dev: {
files: [
{
expand: true,
cwd: 'WebContentSource/src',
src: ['scripts/**/*.js', 'styles/**/*.css'],
dest: 'Epilepsy/Resources/HTMLContent'
},{
expand: true,
cwd: 'WebContentSource/src',
src: ['images/**/*'],
dest: 'Epilepsy/Resources/HTMLContent'
}]
},
dist: {
files: [
{
expand: true,
cwd: 'WebContentSource/src',
src: ['images/**/*'],
dest: 'Epilepsy/Resources/HTMLContent'
}]
}
},
sass: {
all: {
options: {
style: 'compressed',
compass: true
},
files: {
'Epilepsy/Resources/HTMLContent/styles/app.css': 'WebContentSource/src/styles/app.scss',
'Epilepsy/Resources/HTMLContent/styles/eligibility.css': 'WebContentSource/src/styles/eligibility.scss',
'Epilepsy/Resources/HTMLContent/styles/consent.css': 'WebContentSource/src/styles/consent.scss'
}
}
},
ejs: {
all: {
cwd: 'WebContentSource/src/pages/',
src: '*.ejs',
dest: 'Epilepsy/Resources/HTMLContent/pages/',
expand: true,
ext: '.html'
}
},
uglify: {
option: {
mangle: false
},
all: {
files: [{
expand: true,
cwd: 'WebContentSource/src/scripts',
src: '**/*.js',
dest: 'Epilepsy/Resources/HTMLContent/scripts'
}]
}
},
watch: {
dev: {
files: ['*', 'WebContentSource/src/**/*'],
tasks: ['clean', 'copy:dev', 'sass', 'ejs'],
options: {
spawn: false,
livereload: true
}
}
},
connect: {
server: {
options: {
port: 8000,
hostname: '*',
livereload: true
}
}
}
});
grunt.registerTask('dev', ['clean', 'copy:dev', 'sass', 'ejs', 'connect', 'watch']);
grunt.registerTask('dist', ['clean', 'copy:dist', 'sass', 'ejs', 'uglify']);
// load the tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-ejs');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment