vue-bulma / vue-admin

We are refactoring it, using the latest Vue and Bulma. WIP
9.43k stars 1.61k forks source link

Relative build path support #224

Open mirari opened 7 years ago

mirari commented 7 years ago

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并重新编译打包。