public-health-ch/Gruntfile.js

85 lines
2 KiB
JavaScript
Raw Normal View History

2016-12-12 22:43:20 +00:00
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
imagemin: {
media: {
files: [{
expand: true,
cwd: 'media/images/',
src: '{,*/}*.{png,jpg,jpeg,gif}',
dest: 'media/images'
}]
}
},
2017-01-18 11:13:36 +00:00
watch: {
sass: {
files: "publichealth/static/**/*.scss",
tasks: ['sass:dev']
}
},
2017-04-24 16:09:26 +00:00
// TODO: switch to https://github.com/sindresorhus/grunt-sass
2017-01-18 11:13:36 +00:00
sass: { // Task
dev: { // Target
options: { // Target options
style: 'expanded',
sourcemap: 'none'
},
files: { // Dictionary of files
"publichealth/static/mockup/assets/css/main.css": "publichealth/static/css/main.scss"
}
},
dist: {
options: {
style: 'compressed',
sourcemap: 'none'
},
files: {
"publichealth/static/mockup/assets/css/main.min.css": "publichealth/static/css/main.scss"
}
}
},
2016-12-12 22:43:20 +00:00
bgShell: {
_defaults: {
bg: true,
stdout: false,
stderr: false,
},
runDjango: {
cmd: 'python manage.py runserver'
},
},
browserSync: {
dev: {
bsFiles: {
2017-01-18 11:13:36 +00:00
src: [
"publichealth/static/mockup/assets/css/*.css",
"publichealth/static/mockup/*.html"
]
2016-12-12 22:43:20 +00:00
},
options: {
2017-01-18 11:13:36 +00:00
watchTask: true,
2016-12-12 22:43:20 +00:00
proxy: "localhost:8000"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-imagemin');
2017-01-18 11:13:36 +00:00
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
2016-12-12 22:43:20 +00:00
grunt.loadNpmTasks('grunt-bg-shell');
grunt.loadNpmTasks('grunt-browser-sync');
2017-01-18 11:13:36 +00:00
grunt.registerTask('default', ['imagemin', 'sass']);
2016-12-12 22:43:20 +00:00
grunt.registerTask('browser-sync', [
'bgShell',
2017-01-18 11:13:36 +00:00
'browserSync',
'watch'
2016-12-12 22:43:20 +00:00
]);
};