aboutsummaryrefslogtreecommitdiff
path: root/vnext/webpack.config.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-02 13:13:56 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:52 +0300
commitd74e1a6b254409aa3b5b6d1bd1ed81de9cccf521 (patch)
treebffb49d9f632b2370d21b892bfeec3037cb91d25 /vnext/webpack.config.js
parent3338a0d36015752e94bd9009b75f47d92268a35f (diff)
webpack-serve with history api fallback
Diffstat (limited to 'vnext/webpack.config.js')
-rw-r--r--vnext/webpack.config.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/vnext/webpack.config.js b/vnext/webpack.config.js
index 891a3e53..9eb1d7fa 100644
--- a/vnext/webpack.config.js
+++ b/vnext/webpack.config.js
@@ -1,3 +1,6 @@
+const history = require('connect-history-api-fallback');
+const convert = require('koa-connect');
+
module.exports = {
entry: {
"vendor": ['react', 'react-dom', 'react-markdown', 'whatwg-fetch'],
@@ -17,3 +20,14 @@ module.exports = {
]
}
};
+
+module.exports.serve = {
+ content: [__dirname],
+ add: (app, middleware, options) => {
+ const historyOptions = {
+ // ... see: https://github.com/bripkens/connect-history-api-fallback#options
+ };
+
+ app.use(convert(history(historyOptions)));
+ }
+};