Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions common/lib/xmodule/xmodule/static_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class VideoBlock(HTMLSnippet):

def write_module_styles(output_root):
"""Write all registered XModule css, sass, and scss files to output root."""
return _write_styles('.xmodule_display', output_root, sorted(_list_modules(), key=str), 'get_preview_view_css')
return _write_styles('.xmodule_display', output_root, _list_modules(), 'get_preview_view_css')


def write_module_js(output_root):
Expand All @@ -94,20 +94,26 @@ def write_descriptor_js(output_root):

def _list_descriptors():
"""Return a list of all registered XModuleDescriptor classes."""
return [
desc for desc in [
desc for (_, desc) in XModuleDescriptor.load_classes()
]
] + XBLOCK_CLASSES
return sorted(
[
desc for desc in [
desc for (_, desc) in XModuleDescriptor.load_classes()
]
] + XBLOCK_CLASSES,
key=str
)


def _list_modules():
"""Return a list of all registered XModule classes."""
return [
desc.module_class for desc in [
desc for (_, desc) in XModuleDescriptor.load_classes()
]
] + XBLOCK_CLASSES
return sorted(
[
desc.module_class for desc in [
desc for (_, desc) in XModuleDescriptor.load_classes()
]
] + XBLOCK_CLASSES,
key=str
)


def _ensure_dir(directory):
Expand Down Expand Up @@ -269,7 +275,13 @@ def write_webpack(output_file, module_files, descriptor_files):
outfile.write(
textwrap.dedent(u"""\
module.exports = {config_json};
""").format(config_json=json.dumps(config, indent=4))
""").format(
config_json=json.dumps(
config,
indent=4,
sort_keys=True
)
)
)


Expand Down
30 changes: 29 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"underscore.string": "3.3.5",
"webpack": "2.7.0",
"webpack-bundle-tracker": "0.2.1",
"webpack-md5-hash": "0.0.6",
"webpack-merge": "4.1.1",
"whatwg-fetch": "2.0.3",
"which-country": "1.0.0"
Expand Down
4 changes: 3 additions & 1 deletion webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
var Merge = require('webpack-merge');
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var WebpackMd5Hash = require("webpack-md5-hash");
var _ = require('underscore');

var commonConfig = require('./webpack.common.config.js');
Expand All @@ -29,7 +30,8 @@ var optimizedConfig = Merge.smart(commonConfig, {
name: 'commons',
filename: 'commons.[chunkhash].js',
minChunks: 3
})
}),
new WebpackMd5Hash()
]
}});

Expand Down