通常,什麼時候使用webpack加載「index.html」?如何在使用webpack時移動「index.html」?
我想將「index.html」移動到build /中。
我在使用webpack時遇到了npm數據流的麻煩。
在的package.json, 「開始」 的定義是:
"node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js".
但是,我找不到它會從 「的WebPack-DEV-server.js」 跳。
我在它下面發現了兩個說明有關 「的index.html」:
.boolean("history-api-fallback").describe("history-api-fallback", "Fallback to /index.html for Single Page Applications.")
和
console.log("404s will fallback to %s", options.historyApiFallback.index || "/index.html");
當我嘗試在建/移動 「的index.html」 來,瀏覽器返回「無法獲取錯誤」。
「index.html」和webpack.config.js現在在同一個文件夾中。
它的工作!我可以通過只使用「--content-base」選項加載「index.html」。由cp構建得也很好,但是不能告訴從build文件夾得到的結果。但是,根本沒關係!謝謝! – user2255716