0.0.13 • Published 6 years ago
multi-page-refresh-plugin v0.0.13
Multi Page Refresh 404 Plugin
目的是解决开发SPA多路由应用时,在不修改nginx配置的前提下防止出现刷新404的问题
Install
npm install multi-page-refresh-plugin --save-dev Usage
修改webpack配置
//引入
const MultiPageRefreshPlugin = require('multi-page-refresh-plugin');
//增加配置
plugins:[
new MultiPageRefreshPlugin({
routes: [{
path:'/test1'
},
{
path:'/test2'
} ,
...
]
}),
]Options
| name | type | default | Description |
|---|---|---|---|
| routers | Array | [] | 路由配置数组 |
PS: html文件的必须是
index.html,否则会识别不到html文件