久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      react build 路徑不對(duì)怎么辦

      react build路徑不對(duì)的解決辦法:1、找到“node_modules -> react-scripts -> config -> paths.js”;2、修改內(nèi)容為“envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : './');”;3、重新編譯打包即可。

      react build 路徑不對(duì)怎么辦

      本教程操作環(huán)境:Windows10系統(tǒng)、react18.0.0版、Dell G3電腦。

      react build 路徑不對(duì)怎么辦?

      React項(xiàng)目build之后資源文件路徑不正確或打開空白頁(yè)的問題及簡(jiǎn)易解決方法

      找到node_modules -> react-scripts -> config -> paths.js

      修改

      function getServedPath(appPackageJson) {   const publicUrl = getPublicUrl(appPackageJson);   const servedUrl =     envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');//改成'./'   return ensureSlash(servedUrl, true); }
      登錄后復(fù)制

      function getServedPath(appPackageJson) {   const publicUrl = getPublicUrl(appPackageJson);   const servedUrl =     envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : './');   return ensureSlash(servedUrl, true); }
      登錄后復(fù)制

      再重新編譯打包即可

      或者更簡(jiǎn)便的方法是在你的package.json:加入下面這句

      “homepage”: “.”,
      登錄后復(fù)制

      這將確保所有資產(chǎn)路徑都相對(duì)于index.html

      這樣應(yīng)用從中移動(dòng)http://mywebsite.com到http://mywebsite.com/relativepath甚至http://mywebsite.com/relative/path無需重建。

      如果您沒有使用HTML5 pushState歷史記錄API或根本不使用客戶端路由,則無需指定應(yīng)用程序的URL。

      如果還是資源路徑不對(duì),可能recat框架用了BrowserRouter路由會(huì)導(dǎo)致瀏覽器訪問不到相應(yīng)的路由配置,這個(gè)路由有點(diǎn)小問題,可以更換HashRouter即可解決空白或資源路徑錯(cuò)誤問題.

      推薦學(xué)習(xí):《react視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)