Closed azl397985856 closed 4 years ago
我们打包出来的是为了放在服务器上进行调用,使用的是http协议,而本地是file本地文件传输协议进行访问,中间的过程没有http服务器参与解析。
@into-piece 关键点基本有了。 但是报错的原因是什么呢?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
为什么打包好的dist文件夹下的index.html 不能直接打开?比如
file:///Users/lucifer/work/code/test/dist/index.html
。而需要放到服务器上才行,当然这个服务器可以是远程服务器,也可以是本地自己启动的服务器。提示:
PS:
我的习惯是本地开发使用dev,上线之前build一下,serve(一个node cli) 命令跑一下。