rcpress icon indicating copy to clipboard operation
rcpress copied to clipboard

build之后直接打开index.html是空白的,看不了。

Open mywebc opened this issue 4 years ago • 1 comments

dev模式下一切正常的;

build之后打开dist里面的index.html直接白屏 image

我看是404,将index.html改成相对路径,还是不行

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1"
    />
    <title></title>
  <link href="./assets/css/styles.5562608a.css" rel="stylesheet"></head>
  <body>
    <div id="app"></div>
  <script type="text/javascript" src="./assets/js/app.51774c8b.js"></script></body>
</html>

image

console里面是这样的

app.51774c8b.js:6 [RcPress] No matching page found for sidebar item "/guide/group-1-item"

app.51774c8b.js:6 [RcPress] No matching page found for sidebar item "/guide/group-2-item"

app.51774c8b.js:1 GET file:///C:/assets/css/7.styles.bd572ada.css net::ERR_FILE_NOT_FOUND

app.51774c8b.js:1 GET file:///C:/assets/js/7.51774c8b.js net::ERR_FILE_NOT_FOUND

app.51774c8b.js:1 GET file:///C:/assets/css/5.styles.88182343.css net::ERR_FILE_NOT_FOUND

app.51774c8b.js:1 GET file:///C:/assets/js/notFoundWrapper.51774c8b.js net::ERR_FILE_NOT_FOUND

app.51774c8b.js:27 Error: Loading CSS chunk 5 failed.
(/assets/css/5.styles.88182343.css)
    at HTMLLinkElement.n.<computed>.n.<computed>.<computed>.c.push.n.<computed>.f.onerror (app.51774c8b.js:1)
app.51774c8b.js:1 Uncaught (in promise) Error: Loading CSS chunk 7 failed.

app.51774c8b.js:1 Uncaught (in promise) Error: Loading CSS chunk 5 failed.
(/assets/css/5.styles.88182343.css)
    at HTMLLinkElement.n.<computed>.n.<computed>.<computed>.c.push.n.<computed>.f.onerror (app.51774c8b.js:1)

mywebc avatar Jul 17 '20 09:07 mywebc

需要使用nginx托管

wangyi7099 avatar Jul 17 '20 10:07 wangyi7099