Skip to content

spa-fallback is ignore if the path has dot #2190

@alphatr

Description

@alphatr

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

spa-fallback is ignore if the path has . (DOT) such as /login.html in router history mode

Reproduction

use npm init @vitejs/app my-vue-app -- --template vue and visit http://localhost:3000/test.html it response 404

System Info

  • vite version: v2.0.2
  • Operating System: MacOS
  • Node version: v14.15.0
  • Package manager (npm/yarn/pnpm) and version: 6.14.8

Logs (Optional if provided reproduction)

vite:spa-fallback Not rewriting GET /test.html because the path includes a dot (.) character. +390ms

because connect-history-api-fallback will direct . (DOT) file request

https://github.com/bripkens/connect-history-api-fallback#disabledotrule

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions