<commit_before>module.exports = (grunt) ->
  grunt.initConfig
    pkg: grunt.file.readJSON('package.json')

    # Metadata.
    meta:
      distPath:   'dist/'
      vendorPath: 'vendor/'

    watch:
      files: ['js/**', 'css/**', 'img/**', 'html/**', 'vendor/**']
      tasks: ['coffee', 'sass', 'concat', 'copy']

    concat:
      options:
        separator: ';\n' # If minified before concat
      js:
        src: [
          'vendor/jquery/jquery.js'
          'vendor/bootstrap/js/bootstrap.js'
          'js/compile/*.js'
        ]
        dest: 'dist/js/application.js'
      css:
        src: [
          'vendor/bootstrap/css/bootstrap.css'
          "css/compile/*.css"
        ]
        dest: 'dist/css/application.css'

    bower:
      install:
        options:
          targetDir: 'vendor'
          layout: 'byComponent'
          # install: true
          verbose: true
          cleanTargetDir: true
          # cleanBowerDir: false
          # bowerOptions: {}

    clean:
      dist: ["dist/**"]

    coffee:
      compile:
        files:
          'js/compile/main.js': ['js/main.coffee'] # compile and concat into single file

    sass:
      dist:
        options:
          style: 'expanded'
        files:
          'css/compile/main.css': 'css/main.scss'

    copy:
      fonts:
        expand: true
        cwd: 'vendor/bootstrap/font/'
        src: ['**']
        dest: '<%= meta.distPath %>/fonts/'
      imgs:
        expand: true
        cwd: 'img/'
        src: ['**']
        dest: 'dist/img'
      htmls:
        expand: true
        flatten: true
        cwd: 'html/'
        src: ['**']
        dest: '<%= meta.distPath %>'
        filter: 'isFile'

    connect:
      server:
        options:
          port: 9001,
          base: 'dist'

  grunt.loadNpmTasks('grunt-bower-task')
  grunt.loadNpmTasks('grunt-contrib-sass')
  grunt.loadNpmTasks('grunt-contrib-coffee')

  grunt.loadNpmTasks('grunt-contrib-clean')
  grunt.loadNpmTasks('grunt-contrib-concat')
  grunt.loadNpmTasks('grunt-contrib-copy')

  grunt.loadNpmTasks('grunt-contrib-connect')
  grunt.loadNpmTasks('grunt-contrib-watch')

  grunt.registerTask('default', ['bower', 'sass', 'coffee', 'clean', 'concat', 'copy', 'connect', 'watch'])<commit_msg>optimize the sass and coffee task for reload speed<commit_after>module.exports = (grunt) ->
  grunt.initConfig
    pkg: grunt.file.readJSON('package.json')

    # Metadata.
    meta:
      distPath:   'dist/'
      vendorPath: 'vendor/'

    watch:
      script:
        files: 'js/**'
        tasks: ['coffee', 'concat']
      style:
        files: 'css/**'
        tasks: ['sass', 'concat']
      otherFiles:
        files: ['img/**', 'html/**', 'vendor/**']
        tasks: ['concat', 'copy']
      config:
        files: ['gruntfile.coffee', 'bower.json', 'package.json']
        tasks: ['bower', 'sass', 'coffee', 'clean', 'concat', 'copy']


    concat:
      options:
        separator: ';\n' # If minified before concat
      js:
        src: [
          'vendor/jquery/jquery.js'
          'vendor/video.js/js/video.js'

          # MPEG Dash
          'vendor/dashjs/js/dash.debug.js'
          'vendor/videojs-contrib-dash/js/videojs-dash.js'

          # HLS
          'vendor/videojs-contrib-media-sources/js/videojs-media-sources.js'
          'vendor/videojs-contrib-hls/js/videojs.hls.js'

          # Feature Detection
          'vendor/radiant-medialyzer/rml.js'

          'js/compile/*.js'
        ]
        dest: 'dist/js/application.js'
      css:
        src: [
          # 'vendor/bootstrap/css/bootstrap.css'
          'vendor/video.js/css/video-js.css'
          "css/compile/*.css"
        ]
        dest: 'dist/css/application.css'

    bower:
      install:
        options:
          targetDir: 'vendor'
          layout: 'byComponent'
          # install: true
          verbose: true
          cleanTargetDir: true
          # cleanBowerDir: false
          # bowerOptions: {}

    clean:
      dist: ["dist/**"]

    coffee:
      main:
        files:
          'js/compile/main.js': ['js/videojs_dash_resolution.coffee', 'js/main.coffee'] # compile and concat into single file

    sass:
      dist:
        options:
          style: 'expanded'
          sourcemap: 'none'
        files:
          'css/compile/main.css': 'css/main.scss'
    copy:
      fonts:
        expand: true
        cwd: 'vendor/bootstrap/font/'
        src: ['**']
        dest: '<%= meta.distPath %>/fonts/'
      videoFonts:
        expand: true
        cwd: 'vendor/video.js/font/'
        src: ['**']
        dest: '<%= meta.distPath %>/fonts/'
      videojsSwf:
        expand: true
        cwd: 'vendor/video.js/swf/'
        src: ['**']
        dest: '<%= meta.distPath %>/swf/'
      imgs:
        expand: true
        cwd: 'img/'
        src: ['**']
        dest: 'dist/img'
      htmls:
        expand: true
        flatten: true
        cwd: 'html/'
        src: ['**']
        dest: '<%= meta.distPath %>'
        filter: 'isFile'

    connect:
      server:
        options:
          port: 9001,
          base: 'dist'

  grunt.loadNpmTasks('grunt-bower-task')
  grunt.loadNpmTasks('grunt-contrib-sass')
  grunt.loadNpmTasks('grunt-contrib-coffee')

  grunt.loadNpmTasks('grunt-contrib-clean')
  grunt.loadNpmTasks('grunt-contrib-concat')
  grunt.loadNpmTasks('grunt-contrib-copy')

  grunt.loadNpmTasks('grunt-contrib-connect')
  grunt.loadNpmTasks('grunt-contrib-watch')

  # grunt.loadNpmTasks('grunt-contrib-jshint')

  grunt.registerTask('default', ['bower', 'sass', 'coffee', 'clean', 'concat', 'copy', 'connect', 'watch'])
{'fraction_non_alphanumeric': 0.15899357601713063, 'fraction_numerical': 0.0014275517487508922, 'mean_word_length': 1.8567787971457697, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '458761', 'n_tokens_mistral': 1914, 'n_tokens_neox': 1855, 'n_words': 333}