將 localhost/test/ 代理到 localhost:8888/webpack-dev-server 開啟的服務(wù)器端口為 8888工程下面目錄-A|-- index.html這個工程 A/index.html 可以通過 localhost/test/A/index.html 訪問的到a.jsrequire.ensure([], require => {
callback(null, require("./someComponent").default)
}這個時候看起來引用沒錯的,但是在頁面中實際引用地址為 localhost/build/a.js這個時候就出錯了,找不到, 但是瀏覽器如果這樣就可以找到 localhost/test/build/a.js問題出現(xiàn)了,頁面訪問加入這個 a.js 的時候現(xiàn)在少了 test, index.html 訪問卻沒有問題
nginx + webpack nginx 代理靜態(tài)資源地址不對
九州編程
2018-10-18 13:11:37