1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-22 00:43:28 +00:00

update config

This commit is contained in:
ilearnit 2019-04-01 02:35:31 +00:00
parent 895124495c
commit 2dd772d72b
3 changed files with 16 additions and 0 deletions

View File

@ -365,6 +365,18 @@ module.exports = {
//new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), //new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new BundleTracker({filename: './webpack-stats.pro.json'}), new BundleTracker({filename: './webpack-stats.pro.json'}),
// https://webpack.js.org/plugins/commons-chunk-plugin/
new webpack.optimize.CommonsChunkPlugin({
name: 'commons',
filename: '[name]/bundle.common.js',
minChunks: function(module) {
if(module.resource && (/^.*\.(css|scss)$/).test(module.resource)) {
return false;
}
return module.context && module.context.includes('node_modules');
}
})
], ],
// Some libraries import Node modules but don't use them in the browser. // Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works. // Tell Webpack to provide empty mocks for them so importing them works.

View File

@ -1,4 +1,5 @@
{% load seahub_tags i18n staticfiles %} {% load seahub_tags i18n staticfiles %}
{% load render_bundle from webpack_loader %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}"> <html lang="{{ LANGUAGE_CODE }}">
@ -89,6 +90,7 @@
}; };
</script> </script>
<script src="{{ STATIC_URL }}scripts/i18n/{{ LANGUAGE_CODE }}/djangojs.js"></script> <script src="{{ STATIC_URL }}scripts/i18n/{{ LANGUAGE_CODE }}/djangojs.js"></script>
{% render_bundle 'commons' %}
{% block extra_script %}{% endblock %} {% block extra_script %}{% endblock %}
</body> </body>
</html> </html>

View File

@ -51,6 +51,8 @@
} }
</script> </script>
<script src="{{ STATIC_URL }}scripts/i18n/{{ LANGUAGE_CODE }}/djangojs.js"></script> <script src="{{ STATIC_URL }}scripts/i18n/{{ LANGUAGE_CODE }}/djangojs.js"></script>
{% render_bundle 'commons' %}
{% render_bundle 'markdownEditor' 'js' %} {% render_bundle 'markdownEditor' 'js' %}
</body> </body>
</html> </html>