Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative build path support #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mirari
Copy link

@mirari mirari commented Sep 8, 2017

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

…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: http://192.168.1.101/project/, http://project.example.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant