在下面的 HTML 中,該行<script type="module" src="/src/main.tsx"></script>給了我一個警告:
'script[type=module]' 不受 Internet Explorer 支持。Microsoft Edge 工具 (compat-api/html)'
我無意支持 IE11。我正在使用 VSCode 版本:1.64.2。如何忽略此警告?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
<script>
window.global = window;
window.process = {
env: { DEBUG: undefined },
};
var exports = {};
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
uj5u.com熱心網友回復:
根據錯誤源 ( compat-api/html),我假設您使用的是 Webhint。
該規則支持在 中配置支持的瀏覽器串列,.hintrc因此您可以將其配置為排除 Internet Explorer:
// .hintrc
{
"browserslist": [
"defaults",
"not IE 11",
?
]
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/428650.html
