The problem I am trying to solve when I deploy a new build, the users need to get the latest bundle.js and bundle.css, not the browser cached one. The solution the problem is appending a query string to the filename like /client.bundle.js?v=1.01. The 1.01 comes from the package.json's version property.
The content of the index.html, which is contained in the public folder is below. How do I configure the webpack to modify the index.html automatically when building?
<!DOCTYPE html>
<html lang="en">
<head>
<title>Loading...</title>
<meta name="viewport"
content="width=device-width,user-scalable=no,initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,600,700" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/client.bundle.css">
</head>
<body>
<div id="app"></div>
<script src="/bundle.js"></script>
</script>
</body>
</html>