Skip to content

Create-Peace/vite-plugin-history-api-fallback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-history-api-fallback

The middleware specifies the index page when multiple single page HTML5 history APIs are used

Usage

npm install vite-plugin-history-api-fallback

vite config file

import HistoryApiFallback from 'vite-plugin-history-api-fallback'

defineConfig({
  plugins: [
    HistoryApiFallback({
      DEBUG: true,
      rewrites: [
        { from: /^\/doc\/.*$/, to: '/index.html'},
        { from: /^\/mobile\/.*$/, to: '/mobile.html'},
      ]
    })
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published