Skip to content
Snippets Groups Projects
Commit e5f78b32 authored by Tom Robinson's avatar Tom Robinson
Browse files

Fix for React being loaded twice.

If two chunks (with potentially overlapping modules) are intended to be
loaded on the same page we need to use CommonsChunkPlugin to extract the
common dependencies into a commons chunk to prevent some modules from
being loaded twice. Alternatively we could stop using multiple chunks.
parent 55768c8e
No related merge requests found
......@@ -8,10 +8,11 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Metabase</title>
<link rel="stylesheet" href="/app/dist/styles.css"/>
<script charset="utf-8" src="/app/dist/styles.js"></script>
<script src="/app/dist/vendor.js"></script>
<script src="/app/dist/app.js"></script>
<link rel="stylesheet" href="/app/dist/styles.bundle.css"/>
<script charset="utf-8" src="/app/dist/common.bundle.js"></script>
<script charset="utf-8" src="/app/dist/styles.bundle.js"></script>
<script charset="utf-8" src="/app/dist/vendor.bundle.js"></script>
<script charset="utf-8" src="/app/dist/app.bundle.js"></script>
</head>
<body ng-controller="Corvus">
......
......@@ -40,7 +40,7 @@ module.exports = {
// output to "dist"
output: {
path: __dirname + '/resources/frontend_client/app/dist',
filename: '[name].js'
filename: '[name].bundle.js'
},
module: {
......@@ -105,9 +105,9 @@ module.exports = {
// new NgAnnotatePlugin({ add: true }),
// Separates out modules common to multiple entry points into a single common file that should be loaded first.
// Not currently useful but necessary for code-splitting
// new CommonsChunkPlugin('vendor', 'vendor.bundle.js'),
new CommonsChunkPlugin('common', 'common.bundle.js'),
// Extracts initial CSS into a standard stylesheet that can be loaded in parallel with JavaScript
new ExtractTextPlugin('styles.css')
new ExtractTextPlugin('styles.bundle.css')
],
// CSSNext configuration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment