CodeCommitsIssuesPull requestsActionsInsightsSecurity
a70a85ef1808181638d4ed55312f0a93014e8d07

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Gruntfile.js

39lines · modepreview

module.exports = function( grunt ) {
  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      core: {
        src: 'cloudflare/base/frontend/cf_base/cloudflare/js/cloudflare.core.js',
        dest: 'cloudflare/base/frontend/cf_base/cloudflare/js/cloudflare.core.min.js'
      },
      alt: {
        src: 'cloudflare/base/frontend/cf_base/cloudflare/js/cloudflare.js',
        dest: 'cloudflare/base/frontend/cf_base/cloudflare/js/cloudflare-min.js'
      }
    },
    jst: {
      compile: {
        files: {
          "cloudflare/base/frontend/cf_base/cloudflare/js/templates.js": ["cloudflare/base/frontend/cf_base/cloudflare/js/templates/*.html"]
        }
      },
      options: {
        namespace: 'CFT',
        processName: function(filepath) {
          var base = new String(filepath).substring(filepath.lastIndexOf('/') + 1); 
          if(base.lastIndexOf(".") != -1)       
              base = base.substring(0, base.lastIndexOf("."));
          return base;
        }
      }
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jst');

  // Default task(s).
  grunt.registerTask('default', ['uglify', 'jst']);
};