【发布时间】:2020-07-07 18:10:11
【问题描述】:
最近我遇到了一个问题,我们在构建管道 yaml 脚本中使用了“npm run build”命令。然后是'base-href','configuration'等参数。构建通过并且部署成功,但是当我们测试应用程序时,它不会呈现页面,但控制台会出现以下或类似的错误。
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
runtime-es2015.js:1
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
polyfills-es2015.js:1
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
vendor-es2015.js:1
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
main-es2015.js:1
我们在 yaml 中使用的命令是
npm run build -- "-c=<environment> --base-href='/Domain-href-url/'"
SO 中建议的类似问题没有解决或帮助,因为脚本本身在本地工作,使用 package.json cmds 工作正常,使用 vNext 构建管道在 Azure 管道中工作(如果没有传递参数) .但是我们需要环境参数和 base-href。
【问题讨论】:
标签: javascript angular yaml pipeline azure-pipelines-yaml