Call dynamically named bundle from Frontend in ReactJS

36 Views Asked by At

Inside webpack.config.js, i updated bundle.js name as following

output: { 
    path: path.resolve(__dirname, "../dist/"),
    publicPath: "auto",
    filename: "[name].[chunkhash].js",
},

And i am calling it from frontend as following but it's giving error because now bundle.js name has been changed.

<script src="../dist/bundle.js"></script>

How to call them properly?

0

There are 0 best solutions below