From 40b0dd1286caaf54b3269e98d6b2a1da920abcbc Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 11 Jan 2017 08:37:45 +0000 Subject: [PATCH] Speed up build --- plugins/static_build.py | 8 +++++--- theme/templates/base.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/static_build.py b/plugins/static_build.py index f8f1682..eedc36a 100644 --- a/plugins/static_build.py +++ b/plugins/static_build.py @@ -47,17 +47,19 @@ def static_build(*args, **kwargs): 'theme/static/src/js/app.js', '-o', 'theme/static/build/js/app.js' ]) - run_command('Compressing Application', [node_bin('uglifyjs'), 'theme/static/build/js/app.js', UGLIFY_ARGS, '-o', 'theme/static/build/js/app.js']) logger.info('JS built!') run_command('Building Pygments Style', ['pygmentize', '-S', 'github', '-f', 'html', '-a', '.highlight', '>', 'theme/static/src/scss/pygment.css'], True) run_command('Building Styles', [node_bin('node-sass'), 'theme/static/src/scss/index.scss', 'theme/static/build/css/index.css', '--source-map-embed']) - run_command('Prefixing Styles', [node_bin('postcss'), '-u', 'autoprefixer', '-o', 'theme/static/build/css/index.css', 'theme/static/build/css/index.css']) - run_command('Compressing Styles', [node_bin('cleancss'), '-d', '--s0', '-o', 'theme/static/build/css/index.css', 'theme/static/build/css/index.css']) logger.info('SCSS Built!') + if NODE_PRODUCTION: + run_command('Compressing Application', [node_bin('uglifyjs'), 'theme/static/build/js/app.js', UGLIFY_ARGS, '-o', 'theme/static/build/js/app.js']) + run_command('Prefixing Styles', [node_bin('postcss'), '-u', 'autoprefixer', '-o', 'theme/static/build/css/index.css', 'theme/static/build/css/index.css']) + run_command('Compressing Styles', [node_bin('cleancss'), '-d', '--s0', '-o', 'theme/static/build/css/index.css', 'theme/static/build/css/index.css']) + def register(): signals.static_generator_init.connect(static_build) diff --git a/theme/templates/base.html b/theme/templates/base.html index 845daa8..246a66a 100644 --- a/theme/templates/base.html +++ b/theme/templates/base.html @@ -31,7 +31,7 @@ {% include "extras/footer.html" %} - +