integration wip: configurable output dir path for grunt build task
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 11 Dec 2013 16:23:32 +0000 (17:23 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Sun, 15 Dec 2013 21:32:51 +0000 (22:32 +0100)
Gruntfile.js

index 4d929f6..f338192 100644 (file)
@@ -3,13 +3,18 @@
 module.exports = function(grunt) {
     'use strict';
 
 module.exports = function(grunt) {
     'use strict';
 
+    var build_output_dir = grunt.option('output-dir') || 'build',
+        less_files = {};
+
+    less_files[build_output_dir + '/rng.css'] = 'src/editor/styles/main.less';
+
     grunt.initConfig({
         requirejs: {
           compile: {
             options: {
               baseUrl: 'src/editor',
               mainConfigFile: 'src/editor/entrypoint.js',
     grunt.initConfig({
         requirejs: {
           compile: {
             options: {
               baseUrl: 'src/editor',
               mainConfigFile: 'src/editor/entrypoint.js',
-              out: 'build/rng.js',
+              out: build_output_dir + '/rng.js',
               name: 'entrypoint',
               include: ['libs/require']
             }
               name: 'entrypoint',
               include: ['libs/require']
             }
@@ -21,9 +26,7 @@ module.exports = function(grunt) {
                     paths: [''],
                     yuicompress: true
                 },
                     paths: [''],
                     yuicompress: true
                 },
-                files: {
-                    'build/rng.css': 'src/editor/styles/main.less'
-                },
+                files: less_files,
             },
         },
         jshint: {
             },
         },
         jshint: {