webpack-serve-addons-history-api-callback
Usage
npm install -D webpack-serve-addons-history-api-callback
- Add the following to your
webpack-serve
config
example of serve.config.js
const historyApiFallbackAddon = addon; moduleexports = config: './webpack.config.js' content: './public' add: historyApiFallbackAddon;
- Run
webpack-serve
Use with other addons/middlewares
example of serve.config.js
const historyApiFallback = ; moduleexports = config: './webpack.config.js' content: './public' { app; app; };
Options
app;
See: https://github.com/bripkens/connect-history-api-fallback#options
There's frequently used options in the following.
Option | Type | Default value | Description |
---|---|---|---|
index |
string |
/index.html |
Override the index |
rewrites |
{ from: string, to: string }[] |
Override the index when the request url matches a regex pattern | |
htmlAcceptHeaders |
string[] |
['text/html', '*/*'] |
Override the default accepts request headers |