f338192bbaed3936269bf4eb315b9f02b67cfbbe
[fnpeditor.git] / Gruntfile.js
1 /* global module */
2
3 module.exports = function(grunt) {
4     'use strict';
5
6     var build_output_dir = grunt.option('output-dir') || 'build',
7         less_files = {};
8
9     less_files[build_output_dir + '/rng.css'] = 'src/editor/styles/main.less';
10
11     grunt.initConfig({
12         requirejs: {
13           compile: {
14             options: {
15               baseUrl: 'src/editor',
16               mainConfigFile: 'src/editor/entrypoint.js',
17               out: build_output_dir + '/rng.js',
18               name: 'entrypoint',
19               include: ['libs/require']
20             }
21           }
22         },
23         less: {
24             production: {
25                 options: {
26                     paths: [''],
27                     yuicompress: true
28                 },
29                 files: less_files,
30             },
31         },
32         jshint: {
33             all: ['Gruntfile.js', 'src/**/*.js'],
34             options: {
35                 jshintrc: '.jshintrc'
36             }
37         }
38     });
39
40     grunt.loadNpmTasks('grunt-contrib-requirejs');
41     grunt.loadNpmTasks('grunt-contrib-less');
42     grunt.loadNpmTasks('grunt-contrib-jshint');
43
44     grunt.registerTask('build', ['requirejs', 'less:production']);
45     grunt.registerTask('lint', ['jshint']);
46     grunt.registerTask('default', ['build']);
47 };