module.exports = function(grunt) {

  var appConfig = {
    host: 'localhost',
    port: 1337,
    appDir: 'web'
  };

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

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

    connect: {
      options: {
        port: appConfig.port,
        livereload: true,
      },
      dist: {
        options: {
          base: ['web/dist/']
        }
      }
    },

    open: {
      server: {
        path: "http://<%= appConfig.host %>:<%= appConfig.port %>"
      }
    },

    sass: {
      options: {
        sourceMap: true
      },
      dist: {
        files: {
          'dist/gridle.css': 'grid/gridle.scss',
          'web/dist/css/theme.css': 'web/css/theme.scss'
        }
      }
    },

    cssnext: {
      options: {
        sourcemap: false
      },
      dist: {
        files: {
          'dist/gridle.css': 'dist/gridle.css',
          'web/dist/css/theme.css': 'web/dist/css/theme.css'
        }
      }
    },

    postcss: {
      options: {
        map: false,
        processors: [
          require('autoprefixer-core')({
            browsers: ['last 5 versions', '> 5%'],
          }).postcss
        ]
      },

      dist: {
        src: ['dist/gridle.css', 'web/dist/css/theme.css']
      }
    },

    cssmin: {
      options: {
        shorthandCompacting: false,
        roundingPrecision: -1
      },

      target: {
        files: {
          'dist/gridle.min.css': ['dist/gridle.css'],
          'web/dist/css/theme.min.css': ['web/dist/css/theme.css'],
        }
      }
    },

    uglify: {
      dist: {
        files: {
          'web/dist/js/main.min.js': ['web/js/main.js']
        }
      }
    },

    svgmin: {
      options: {
        plugins: [
          { removeViewBox: false },
          { removeUselessStrokeAndFill: false }
        ]
      },

      dist: {
        files: {
          'web/dist/images/menu.svg': ['web/images/*.svg']
        }
      }
    },

    jade: {
      html: {
        files: {
          'web/dist/': ['web/*.jade']
        },

        options: {
          client: false,
          pretty: true
        }
      }
    },

    clean: {
      options: {
        dot: true
      },
      dist: {
        src: ['dist/', 'web/dist/']
      }
    },

    watch: {
      options: {
        livereload: true
      },
      grunt: {
        files: 'Gruntfile.js'
      },
      sass: {
        files: ['grid/*.scss', 'web/css/**/*.scss'],
        tasks: ['sass', 'postcss', 'cssnext', 'cssmin']
      },
      uglify: {
        files: ['web/js/**/*.js'],
        tasks: ['uglify']
      },
      svgmin: {
        files: ['web/images/**/*.svg'],
        tasks: ['svgmin']
      },
      jade: {
        files: ['web/**/*.jade'],
        tasks: ['jade']
      }
    }
  });

  grunt.registerTask('serve', [
    'connect',
    'open',
    'watch'
  ]);

  grunt.registerTasks('view' [
    'connect',
    'open',
    'watch'
  ]);

  grunt.registerTask('default', ['serve']);
}

@@ -2289,17 +2289,8 @@
 c: %5B
-'dist/', 
 'web
@@ -2918,74 +2918,142 @@
 %0A%0A  
-grunt.registerTasks('view' %5B%0A    'connect',%0A    'ope
+// Clean the web/dist folder which is only for viewing the grid in action%0A  // locally%0A  //%0A  grunt.registerTask('clea
 n',
+ %5B
 %0A    '
-watch
+clean
 '%0A  

remove view task and add clean task