javascript - Attempting to route a URL with a dot leads to 404 with webpack dev server -


i'm using webpack's dev server ease of local development. i'm working on single page app, i've enabled historyapifallback:

common.devserver = {   outputpath: path.join(__dirname, 'www', outdir),   historyapifallback: true }; 

however, whenever try browse url contains period (such /ui/alerts/map.postplay), get

cannot /ui/alerts/map.postplay

how can convince webpack-dev-server let me use these urls?

update: can set historyapifallback to:

historyapifallback: {   disabledotrule: true } 

(thanks benr fixing this!)

the trouble lies not in webpack-dev-server historyapifallback config (technically, webpack uses connect-history-api-fallback). there's known bug relating urls periods.

you can update config historyapifallback rewrite urls containing periods:

historyapifallback: {   rewrites: [     {from: /\./, to: '/'}   ] } 

since operates on req.url, should fine if you're doing local dev on other localhost via hosts file, etc.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -