unity生成webgl 运行时,浏览器出现:Unexpected token ‘<‘ 报错的解决办法

Unexpected token ‘<‘ 报错的解决办法

在生成的webgl文件中 添加:web.config文件:


<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".png" />
            <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
            <mimeMap fileExtension=".jsgz" mimeType="application/octet-stream" />
            <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
            <mimeMap fileExtension=".png" mimeType="image/png" />
            <mimeMap fileExtension=".unity3d" mimeType="application/octet-stream" />
            <mimeMap fileExtension=".unityweb" mimeType="application/binary" />
        staticContent>
    system.webServer>
configuration>
![在这里插入图片描述](https://img-blog.csdnimg.cn/a752d5dd319a46d6a5804920d5c91e44.png)

你可能感兴趣的:(成长,unity,webgl)