I'm trying to figure out how to configure Webpack 4's SplitChunks plugin. If I allow it to put modules in a shared/common chunk, it seems those modules are loaded async.
entry.js:
require("expose-loader?$!jquery");
This is included in the page:
<script src="bundle.js"></script>
<script>
$(function() {
// do something spectacular
});
</script>
Without SplitChunks, JQuery is inside bundle.js
and is immediately available to the page. However, once I enable SplitChunks and JQuery gets moved into a separate chunk, the page triggers an error: $ is not defined