Skip to content

Instantly share code, notes, and snippets.

@neokoenig
Created February 20, 2018 20:30
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 neokoenig/c0603a6eec2187401050049d68d91dc9 to your computer and use it in GitHub Desktop.
Save neokoenig/c0603a6eec2187401050049d68d91dc9 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
sass:{
files: ['sass/*.scss'],
tasks: ['sass', 'cssmin']
}
},
sass: {
dist: {
files: {
'../web/assets/css/style.css' : 'sass/oms.scss'
}
}
},
concat: {
options: {
separator: ';',
stripBanners: true,
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
dist: {
src: ['js/*.js'],
dest: '../web/assets/js/main.min.js'
}
},
uglify:{
options: {
manage: false,
preserveComments: 'all' //preserve all comments on JS files
},
my_target:{
files: {
'../web/assets/js/main.min.js' : ['js/*.js']
}
}
},
cssmin:{
my_target:{
files: [{
expand: true,
cwd: 'css/',
src: ['*.css', '!*.min.css'],
dest: 'css/',
ext: '.min.css'
}]
}
}
});
// Load the plugin that provides the "compass" task.
grunt.loadNpmTasks('grunt-contrib-compass');
// Load the plugin that provides the "watch" task.
grunt.loadNpmTasks('grunt-contrib-watch');
// Load the plugin that provides the "sass" task.
grunt.loadNpmTasks('grunt-contrib-sass');
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Load the plugin that provides the "concat" task.
grunt.loadNpmTasks('grunt-contrib-concat');
// Load the plugin that provides the "cssmin" task.
grunt.loadNpmTasks('grunt-contrib-cssmin');
// Default task(s).
grunt.registerTask('default', ['uglify','cssmin']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment