1
Fork 0

Speed up build

This commit is contained in:
Jake Howard 2017-01-11 08:37:45 +00:00
parent f005667593
commit 40b0dd1286
2 changed files with 6 additions and 4 deletions

View file

@ -47,17 +47,19 @@ def static_build(*args, **kwargs):
'theme/static/src/js/app.js', 'theme/static/src/js/app.js',
'-o', 'theme/static/build/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!') 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 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('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!') 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(): def register():
signals.static_generator_init.connect(static_build) signals.static_generator_init.connect(static_build)

View file

@ -31,7 +31,7 @@
{% include "extras/footer.html" %} {% include "extras/footer.html" %}
<script src="/static/js/jquery.js" type="text/javascript"></script> <script src="/static/js/jquery.js" type="text/javascript"></script>
<script src="/static/js/libs.js" type="text/javascript"></script> <script src="/static/js/bootstrap.js" type="text/javascript"></script>
<script src="/static/js/app.js" type="text/javascript"></script> <script src="/static/js/app.js" type="text/javascript"></script>
</body> </body>
</html> </html>