精簡版服務器似乎被忽略了我的企圖覆蓋默認的指數。這是得到精簡版服務器來識別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爲精簡版服務器?