我已经用一个新项目对此进行了测试,没有什么独特之处。
ng new debug-project
然后我在导致这个的头部部分添加了一些标签。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DebugProject</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="user-scalable=no, width=device-width" />
<meta name="viewport" content="width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
<meta name="viewport" content="width=device-width; initial-scale=1; minimum-scale=1; maximum-scale=1; user-scalable=0">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
之后ng build --prod
,html现在看起来像这样,浏览器无法读取。请注意视口元标记值中缺少的空格。width, initial-scale=1
, 成为width,initial-scale=1
.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DebugProject</title>
<base href="/">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="viewport" content="user-scalable=no,width=device-width" />
<meta name="viewport" content="width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
<meta name="viewport" content="width=device-width;initial-scale=1;minimum-scale=1;maximum-scale=1;user-scalable=0">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="styles.ac89bfdd6de82636b768.bundle.css" rel="stylesheet" />
</head>
<body>
<app-root></app-root>
<script type="text/javascript" src="inline.318b50c57b4eba3d437b.bundle.js"></script>
<script type="text/javascript" src="polyfills.bf95165a1d5098766b92.bundle.js"></script>
<script type="text/javascript" src="main.8df9530e9d55fa951861.bundle.js"></script>
</body>
</html>
我的设置有问题吗?我可能需要在项目上安装一些东西?