精简版服务器似乎被忽略了我的企图覆盖默认的指数。这是得到精简版服务器来识别BS-config.js的“server.index”覆盖的正确方法?
我有BS-config.json:
{
"server": {
"baseDir": "src",
"index": "/index.3.html",
"routes": {
"/node_modules": "node_modules"
}
}
}
我使用的精简版,服务器版2.3.0,就像这样:
> lite-server -c=bs-config.json
browser-sync config **
{ injectChanges: false,
files: [ './**/*.{html,htm,css,js}' ],
watchOptions: { ignored: 'node_modules' },
server:
{ baseDir: 'src',
middleware: [ [Function], [Function] ],
directory: true,
index: '/index.3.html',
routes: { '/node_modules': 'node_modules'
}
}
}
在上面的控制台日志输出,它承认“index.3.html”,然而,当浏览器请求“GET http://localhost”的BS-config.json指数默认情况下,控制台显示它正试图以服务代替的index.html index.3.html。
[Browsersync] Serving files from: src
[Browsersync] Watching files...
17.09.04 22:35:51 404 GET /index.html
我也试图提供BS-config.js:
"use strict";
module.exports = {
"server": {
"baseDir": "src",
index: "i/index.3.html",
"directory":true,
"routes": {
"/node_modules": "node_modules"
}
// middleware,: {
// // overrides the second middleware default with new settings
// 1: require('connect-history-api-fallback')({index: '/index.3.html', verbose: true})
// }
}
}
,并与运行精简版服务器:
> lite-server -c=bs-config.js
但行为是一样的。
问:我怎么重写BS-配置的server.index为精简版服务器?