diff --git a/dev-server.js b/dev-server.js index 45d892da5..5f99d30b3 100644 --- a/dev-server.js +++ b/dev-server.js @@ -19,7 +19,6 @@ 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(); @@ -40,10 +39,12 @@ app.use( // Inject Stencil's dev server iframe into the main entry point app.use(/^\/$/, async (req, res, next) => { let index = await fs.readFile('./docs/index.html', 'utf8'); - index = index.replace( - '', - '' - ); + index = index + .replace('', '') + .replace( + '', + '' + ); res.type('html').send(index); }); app.use('/dist', express.static('./dist')); @@ -59,8 +60,7 @@ setTimeout(() => { port: browserPort, proxy: { target: `http://localhost:${proxyPort}`, - ws: true, - middleware: [historyFallback()] + ws: true }, logLevel: 'silent', notify: false, diff --git a/docs/index.html b/docs/index.html index 08a15b6c5..1672fe06a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -49,7 +49,7 @@ }, repo: '', repo: 'https://github.com/shoelace-style/shoelace/', - routerMode: 'history', + routerMode: window.ShoelaceDevServer ? 'hash' : 'history', search: { maxAge: 86400000, // Expiration time, the default one day paths: 'auto', // or 'auto' diff --git a/package.json b/package.json index c9ed6cafe..ba067ea8f 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "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",