Skip to content

Commit

Permalink
fix(demo-pwa): dev-server config
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Jan 10, 2023
1 parent 3176cbe commit 941bf8d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ui/demo-pwa/web-dev-server.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {existsSync} from 'node:fs';

// https://modern-web.dev/docs/dev-server/cli-and-configuration/#configuration-file
export default {
const config = {
port: 8080,
open: true,
watch: true,
Expand All @@ -17,11 +19,13 @@ export default {
// if file not found, return app index.html
if (!(
context.url === '/' ||
context.url.startsWith('/__web-dev-server') ||
fs.existsSync(config.rootDir + context.url)
context.url.startsWith('/__w') ||
existsSync(config.rootDir + context.url)
)) {
context.url = config.appIndex;
}
return next();
}],
};

export default config;

0 comments on commit 941bf8d

Please sign in to comment.