3 module.exports = function(grunt) {
5 var build_output_dir = grunt.option('output-dir') || 'build',
7 jshint_targets = grunt.option('jshint-targets');
9 less_files[build_output_dir + '/rng.css'] = 'src/editor/styles/main.less';
16 baseUrl: 'src/editor',
17 mainConfigFile: 'src/editor/entrypoint.js',
18 out: build_output_dir + '/rng.js',
20 include: ['libs/require', 'libs/ace/mode-xml'],
21 generateSourceMaps: true,
23 // The following two settings are required for source maps to work,
24 // see: http://requirejs.org/docs/optimization.html#sourcemaps
25 preserveLicenseComments: false,
26 optimize: grunt.option('optimize') || 'uglify2'
36 rootpath: 'src/editor/styles/'
42 all: jshint_targets ? jshint_targets.split(',') : ['Gruntfile.js', 'src/**/*.js'],
50 {src: ['libs/bootstrap/img/**'], dest: build_output_dir+'/'},
57 dest: grunt.option('git-hooks-dir') || '.git/hooks',
62 template: 'pre-commit.template.js'
68 grunt.loadNpmTasks('grunt-contrib-requirejs');
69 grunt.loadNpmTasks('grunt-contrib-less');
70 grunt.loadNpmTasks('grunt-contrib-jshint');
71 grunt.loadNpmTasks('grunt-contrib-copy');
72 grunt.loadNpmTasks('grunt-githooks');
74 grunt.registerTask('build', ['requirejs', 'less:production', 'copy:resources']);
75 grunt.registerTask('lint', ['jshint']);
76 grunt.registerTask('default', ['build']);