From c988c1287bd01e55dc32153a52e8b9ec97daf1de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 28 Jan 2014 11:41:11 +0100 Subject: [PATCH 1/1] build: --editor-optimize option for environments This allows to turn off build minification and have meaningful sentry logs from FF, which doesn't report column numbers yet. --- apps/build/management/commands/build.py | 11 ++++++++++- apps/wiki/static/wiki/editor | 2 +- deployment/base.py | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) 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']) diff --git a/apps/wiki/static/wiki/editor b/apps/wiki/static/wiki/editor index cd087df9..2d049782 160000 --- a/apps/wiki/static/wiki/editor +++ b/apps/wiki/static/wiki/editor @@ -1 +1 @@ -Subproject commit cd087df95dce695f044472b6f017fbb697e90b7f +Subproject commit 2d049782d8d9179d28807567dfa0daeb39dbfb7e diff --git a/deployment/base.py b/deployment/base.py index 3c1de902..6a1fd559 100644 --- a/deployment/base.py +++ b/deployment/base.py @@ -25,6 +25,8 @@ class Environment(Task): % (self.npm_bin, os.path.join(env['app_path'], 'npm_env')) if 'node_bin_path' in self.env_vars: build_cmd += ' --node-bin-path=%s' % self.env_vars['node_bin_path'] + if 'editor_optimize' in self.env_vars: + build_cmd += ' --editor-optimize=%s' % self.env_vars['editor_optimize'] env.pre_collectstatic = [ Command([build_cmd], '') -- 2.20.1