Create vendors bundle

This commit is contained in:
Peter Stuifzand 2020-10-31 14:02:14 +01:00
parent 2b8dc55ff0
commit 561d3782e9
2 changed files with 15 additions and 0 deletions

View File

@ -42,4 +42,17 @@ module.exports = {
contentBase: './dist', contentBase: './dist',
hot: true hot: true
}, },
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all'
}
}
}
}
}; };

View File

@ -6,6 +6,7 @@
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="redirect_uri" href="{{ .RedirectURI }}" /> <link rel="redirect_uri" href="{{ .RedirectURI }}" />
<link rel="stylesheet" href="/public/vendors.css" />
<link rel="stylesheet" href="/public/index.css" /> <link rel="stylesheet" href="/public/index.css" />
<link rel="stylesheet" href="https://unpkg.com/prismjs@1.20.0/themes/prism-tomorrow.css"> <link rel="stylesheet" href="https://unpkg.com/prismjs@1.20.0/themes/prism-tomorrow.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
@ -97,6 +98,7 @@
[[/results]] [[/results]]
</ul> </ul>
</div> </div>
<script async src="/public/vendors.bundle.js"></script>
<script async src="/public/index.bundle.js"></script> <script async src="/public/index.bundle.js"></script>
</body> </body>
</html> </html>