Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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