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):
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'])
% (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], '')