Build and handle jsfiles using webpack instead of django-pipeline.

Also renames bundle.js to translations.js.
This commit is contained in:
Mehanig
2017-05-23 15:03:53 -07:00
committed by Tim Abbott
parent 4f39d4fc22
commit 3f5d0e69fb
14 changed files with 45 additions and 24 deletions

View File

@@ -312,6 +312,7 @@ TEMPLATES = [
'jinja2.ext.i18n',
'jinja2.ext.autoescape',
'pipeline.jinja2.PipelineExtension',
'webpack_loader.contrib.jinja2ext.WebpackExtension',
],
'context_processors': [
'zerver.context_processors.zulip_default_context',
@@ -360,6 +361,7 @@ INSTALLED_APPS = [
'confirmation',
'guardian',
'pipeline',
'webpack_loader',
'zerver',
'social_django',
]
@@ -976,7 +978,6 @@ JS_SPECS = {
'js/ui_init.js',
'js/emoji_picker.js',
'js/compose_ui.js',
# JS bundled by webpack is also included here if PIPELINE_ENABLED setting is true
],
'output_filename': 'min/app.js'
},
@@ -1008,12 +1009,16 @@ JS_SPECS = {
}
}
if PIPELINE_ENABLED:
# This is also done in test_settings.py, see comment there..
JS_SPECS['app']['source_filenames'].append('js/bundle.js')
app_srcs = JS_SPECS['app']['source_filenames']
WEBPACK_STATS_FILE = 'webpack-stats-dev.json' if DEVELOPMENT else 'webpack-stats-production.json'
WEBPACK_LOADER = {
'DEFAULT': {
'BUNDLE_DIR_NAME': 'webpack-bundles/',
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-bundles', WEBPACK_STATS_FILE),
}
}
########################################################################
# LOGGING SETTINGS
########################################################################