Add support for CommonsChunkPlugin for Webpack.

This lets us consolidate chunks of JavaScript that are common to
multiple bundles, so that they can live in their own shared file. This
will be more relevant when we have UI components -- there's actually
very little shared code right now.
This commit is contained in:
David Ormsbee
2017-06-21 21:46:59 -04:00
parent 1ad2b66e14
commit 962b09f73c
3 changed files with 28 additions and 0 deletions

View File

@@ -96,6 +96,7 @@ source, template_path = Loader(engine).load_template_source(path)
try:
return Template("""
{% load render_bundle from webpack_loader %}
{% render_bundle "commons" %}
{% render_bundle entry %}
<script type="text/javascript">
{% autoescape off %}{{ body }}{% endautoescape %}