From be78be7caf0f018253fd2b37739fbb4eab4defee Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Tue, 14 Jul 2020 16:26:37 -0400 Subject: [PATCH] Use docsify history mode --- dev-server.js | 4 +++- docs/index.html | 2 +- package.json | 1 + vercel.json | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 vercel.json diff --git a/dev-server.js b/dev-server.js index ad51b1658..45d892da5 100644 --- a/dev-server.js +++ b/dev-server.js @@ -19,6 +19,7 @@ const chalk = require('chalk'); const express = require('express'); const fs = require('fs').promises; const path = require('path'); +const historyFallback = require('connect-history-api-fallback'); const { createProxyMiddleware } = require('http-proxy-middleware'); const app = express(); @@ -58,7 +59,8 @@ setTimeout(() => { port: browserPort, proxy: { target: `http://localhost:${proxyPort}`, - ws: true + ws: true, + middleware: [historyFallback()] }, logLevel: 'silent', notify: false, diff --git a/docs/index.html b/docs/index.html index dbf655cd3..08a15b6c5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -49,7 +49,7 @@ }, repo: '', repo: 'https://github.com/shoelace-style/shoelace/', - routerMode: 'hash', // or 'history' + routerMode: 'history', search: { maxAge: 86400000, // Expiration time, the default one day paths: 'auto', // or 'auto' diff --git a/package.json b/package.json index ba067ea8f..c9ed6cafe 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "browser-sync": "^2.26.7", "chalk": "^4.0.0", "concurrently": "^5.1.0", + "connect-history-api-fallback": "^1.6.0", "del": "^5.1.0", "download": "^8.0.0", "eslint": "^6.8.0", diff --git a/vercel.json b/vercel.json new file mode 100644 index 000000000..ec131460c --- /dev/null +++ b/vercel.json @@ -0,0 +1,3 @@ +{ + "routes": [{ "src": "/(.*)", "dest": "/" }] +}