小编Har*_*rle的帖子

WebStorm 上的 %PUBLIC_URL% 编辑器警告

带有 create-react-app 的 WebStorm 在/public/index.html文件中有一个文件夹路径/public标记为%PUBLIC_URL%.

它找不到目录,%PUBLIC_URL%因为它不存在,也不应该存在。

除了使用 抑制错误之外<!--suppress HtmlUnknownTarget -->,Webstorm 中是否还有一种方法可以将目录变量(如 , )别名%PUBLIC_URL%/publicfor 开发中没有编辑器错误的根路径?

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="theme-color" content="#000000">
    <!--
      manifest.json provides metadata used when your web app is added to the
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
    -->
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
    <!--
      Notice the use of %PUBLIC_URL% in the tags above.
      It will be replaced with …
Run Code Online (Sandbox Code Playgroud)

intellij-idea webstorm reactjs create-react-app

11
推荐指数
1
解决办法
1221
查看次数