Skip to content

Instantly share code, notes, and snippets.

@baranovxyz
Last active October 19, 2017 07:55
Show Gist options
  • Save baranovxyz/eb900749b1b91c19c3d3d53b485bb975 to your computer and use it in GitHub Desktop.
Save baranovxyz/eb900749b1b91c19c3d3d53b485bb975 to your computer and use it in GitHub Desktop.
module.exports = {
entry: {
main: [appPath("src", "index.ts"), appPath("src", "css", "styles.scss")]
},
output: {
filename: "bundle.[hash].js",
path: appPath("build")
},
devServer: {
historyApiFallback: {
index: "index.html",
rewrites: [
// should redirect to bundle with js
/**
* How to reference bundle.[hash].js from output here?
*/
{ from: /.*\/bundle.*/, to: "/bundle.[hash].js" },
// should redirect other requests to index.html
{ from: /./, to: "/" }
]
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment