17 Temmuz 2015 Cuma

gruntfile.js dosyam

module.exports = function(grunt) {

grunt.initConfig({
      
        pkg: grunt.file.readJSON('package.json'),
      

            watch: {
              options:{
                  livereload: true
              },
              css: {
                files: 'sass/style.scss',
                tasks: ['sass','uglify']
              },
            },

              sass: {                       
                dist: {                         
                  options: {                  
                    style: 'compressed'
                  },
                  files: {                      
                    'css/style.css': 'sass/style.scss',     
                  }
                }
              },

            cssmin: {
              target: {
                files: [{
                  expand: true,
                  cwd: 'css',
                  src: ['*.css', '!*.min.css'],
                  dest: 'css',
                  ext: '.min.css'
                }]
              }
            },

          uglify: {
            options: {
              mangle: false
            },
            my_target: {
              files: {
                'js/custom.min.js': ['js/custom.js']
              }
            }
          },

          express: {
            all: {
              options: {
                port: 9000,
                hostname: 'localhost',
                bases: ['.'],
                livereload: true
              }
            }
          },

        concat: {
          jquery: {
            files: {
              'js/jquery.js': ['bower_components/jquery/dist/jquery.js']
            }
          }
         }
    });



    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-express');




    grunt.registerTask('server', ['express','watch']);

  
}