From 962b09f73c5cd659bba4ee5f040c33544fb7f81c Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Wed, 21 Jun 2017 21:46:59 -0400 Subject: [PATCH] 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. --- .../pipeline_mako/templates/static_content.html | 1 + common/static/common/js/karma.common.conf.js | 12 ++++++++++++ webpack.config.js | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/common/djangoapps/pipeline_mako/templates/static_content.html b/common/djangoapps/pipeline_mako/templates/static_content.html index 1af6ee8a14..014001593d 100644 --- a/common/djangoapps/pipeline_mako/templates/static_content.html +++ b/common/djangoapps/pipeline_mako/templates/static_content.html @@ -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 %}