2016-12-22 10 views
0

プロジェクトでLiteServerを使用しようとしていますが、デフォルトの時計をindex.htmlに変更できません。現在のファイルはindex1.htmlです。私はnpm initの間にエントリポイントとしてapp2.jsを指定したので、JSのデフォルトを変更することはできましたが、HTMLは変更できませんでした。LiteServerのデフォルトのファイル監視オプションを変更する方法

> lite-server 

Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults... 
** browser-sync config ** 
{ injectChanges: false, 
    files: [ './**/*.{html,htm,css,js}' ], 
    watchOptions: { ignored: 'node_modules' }, 
    server: { baseDir: './', middleware: [ [Function], [Function] ] } } 
[BS] Access URLs: 
-------------------------------------- 
     Local: http://localhost:3000 
    External: http://10.40.244.189:3000 
-------------------------------------- 
      UI: http://localhost:3001 
UI External: http://10.40.244.189:3001 
-------------------------------------- 
[BS] Serving files from: ./ 
[BS] Watching files... 
16.12.21 18:43:32 200 GET /index.html 
16.12.21 18:43:32 200 GET /style.css 
16.12.21 18:43:33 200 GET /app2.js 
16.12.21 18:43:34 404 GET /favicon.ico 

私はdocを知っているがbs-config.jsonファイルの使用に言及したが、私は、このための構文を持つすべての参照を取得できませんでした。

助けていただければ幸いです!


UPDATE - 私は現在bs-config.jsonファイルでこれを持っていますが、何の使用 -

{ 
    "files": ["style.css", "app2.js", "index1.html"] 
} 
+0

気にしないで、私は '/ index1.html'をルートに追加しただけです。 –

答えて

0

LITE-サーバがBrowserSyncに基づいていません。 bs-config.jsはbrowsersyncの設定ファイルです。設定オプションは、ここに記載されています: https://browsersync.io/docs/options

たとえば、代わりに自分のルートでそれを設定するのでは、BS-config.jsonが含まれている可能性があり、index1.htmlであるためにあなたのデフォルトのINDXを設定するには:

{ 
    "server": { 
    "baseDir": "src", 
    "index": "/index1.html", 
    "routes": { 
     "/node_modules": "node_modules" 
    } 
    } 
} 
関連する問題