X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/fc0461ffeb667b5151b6c1bf354388952a6fb119..341186bb54597b9923b70550e0af90d1189d8394:/apps/build/management/commands/build.py?ds=inline

diff --git a/apps/build/management/commands/build.py b/apps/build/management/commands/build.py
index d87d3b48..50097cff 100644
--- a/apps/build/management/commands/build.py
+++ b/apps/build/management/commands/build.py
@@ -27,6 +27,12 @@ class Command(BaseCommand):
             type='string',
             default=None,
             help='Destination path of npm environment, defaults to ./node_modules'),
+        make_option('--editor-optimize',
+            action='store',
+            dest='editor_optimize',
+            type='string',
+            default=None,
+            help='Optimization strategy for editor build'),
         )
 
     def handle(self, **options):
@@ -50,6 +56,9 @@ class Command(BaseCommand):
         if options['node_bin_path']:
             # grunt needs npm binary to be foundable in PATH
             os.environ['PATH'] = '%s:%s' % (options['node_bin_path'], os.environ['PATH'])
-        call(['./node_modules/.bin/grunt', 'build', '--output-dir=%s' % build_dir], cwd = rng_base_dir)
+        args =  ['./node_modules/.bin/grunt', 'build', '--output-dir=%s' % build_dir]
+        if options['editor_optimize']:
+            args.append('--optimize=%s' % options['editor_optimize'])
+        call(args, cwd = rng_base_dir)
 
         call_command('collectstatic', interactive = False, ignore_patterns = ['editor'])