Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed the problem that the URLs of fonts and images in the CSS files are incorrect when
assetsPublicPath
set to./
in production environment.Now the 'dist' directory can be visited by any URL root path at the same time.
For example:
visit
http://192.168.1.101/project/
in intranet,and visit
http://project.example.com/
in internet.修正
assetsPublicPath
被设置成./
时,CSS文件中的图片、字体等引用地址错误的问题。现在项目可以支持发布到任意层级的目录。比如在维护主机的内网环境下使用
http://192.168.1.101/project/
访问主页,同时又可以在广域网下以http://project.example.com/
这样的根路径访问同一主机。如果项目地址发生变动,比如从
http://www.example.com/project-a/
变成了http://www.example.com/project-b/sub-a/
,也仅仅只需要调整项目文件目录,而不需要修改assetsPublicPath
并重新编译打包。