Skip to content

Commit a1feee0

Browse files
authored
Fall back to history api for 404 errors (#463)
* Fall back to history api for 404 errors * Update failing test
1 parent e2b252c commit a1feee0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@ async function serve(configs: webpack.Configuration[], args: any, esbuild = fals
265265
})
266266
);
267267

268+
app.use(
269+
base,
270+
history({
271+
disableDotRule: true
272+
})
273+
);
274+
268275
serveStatic(app, outputDir, args.mode, args.compression, base);
269276

270277
const defaultKey = path.resolve('.cert', 'server.key');

tests/unit/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ describe('command', () => {
551551
);
552552
setTimeout(
553553
dfd.callback(() => {
554-
assert.strictEqual(useStub.callCount, 7);
554+
assert.strictEqual(useStub.callCount, 8);
555555
assert.isTrue(
556556
hotMiddleware.calledWith(compiler, {
557557
heartbeat: 10000

0 commit comments

Comments
 (0)