带有 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)