polyfills-es2015、vendor-es2015、main-es2015 和其他由于 MIME 类型不允许 (text/html) 而被阻止?

polyfills-es2015, vendor-es2015, main-es2015 and others are blocked due MIME type not allowed(text/html)?

您好,我在部署 angular 应用程序时遇到问题,我的意思是当我从 angular 提供它时它工作正常,但是当我在 [=38] 上进行部署时=] 服务器我收到错误,我看不到与组件和模块相关的任何内容,我 index.html 中的一个小导航栏已加载,仅此而已:

但是什么时候从 angular...

我在 Tomcat 上使用 Angular+PHP 进行了另一个部署,但从未出现过这些错误。你知道我为什么得到这个吗? 也许是关于 text/htmlaplication/json 但不确定。

如果您检查 dist 文件夹中的 index.html,您会发现这些:

它是这样工作的!!: 当你在 build 生成的 index.html 上进行部署时,由于 "/" 而产生了引用 当它必须是 "./" 时,我不知道它是如何以这种方式自行生成的,但你也可以通过 <base href='http://localhost:port/distName/appName/'>

解决