public-health-ch/Gruntfile.js

87 lines
1.9 KiB
JavaScript
Raw Normal View History

const sass = require('node-sass');
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']
}
},
sass: { // Task
dev: { // Target
options: { // Target options
implementation: sass,
sourcemap: false
2017-01-18 11:13:36 +00:00
},
files: { // Dictionary of files
2017-05-03 06:51:43 +00:00
"./assets/css/main.css": "publichealth/static/css/main.scss"
2017-01-18 11:13:36 +00:00
}
},
dist: {
options: {
outputStyle: 'compressed',
implementation: sass,
sourcemap: true
2017-01-18 11:13:36 +00:00
},
files: {
2017-05-03 06:51:43 +00:00
"./assets/css/main.min.css": "publichealth/static/css/main.scss"
2017-01-18 11:13:36 +00:00
}
}
},
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: [
2017-05-03 06:51:43 +00:00
"./assets/css/*.css",
"./*.html"
2017-01-18 11:13:36 +00:00
]
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-watch');
2016-12-12 22:43:20 +00:00
grunt.loadNpmTasks('grunt-bg-shell');
grunt.loadNpmTasks('grunt-browser-sync');
grunt.loadNpmTasks('grunt-sass');
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
]);
};