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

#require指令引用静态资源绝对路径的问题 #11

Open
flyingzl opened this issue Aug 25, 2015 · 2 comments
Open

#require指令引用静态资源绝对路径的问题 #11

flyingzl opened this issue Aug 25, 2015 · 2 comments

Comments

@flyingzl
Copy link

J2EE应用部署后,有一个context,一般我们可以通过$request.getContextPath来获取绝对路径,然后拼接上静态资源例如,例如 <script src="$request.contextPath/static/js/require.js"></script>

由于#requrie是根据map.json表来映射的,而且我也不可以在fis-conf.js中把url写死,有什么更好的解决方法?

@flyingzl flyingzl changed the title #require指令如何解决静态资源绝对引用的问题 #require指令引用静态资源绝对路径的问题 Aug 25, 2015
@2betop
Copy link
Contributor

2betop commented Aug 25, 2015

url 可以不写死,通过 domain 来动态加前缀。

http://fex-team.github.io/fis-site/docs/api/fis-conf.html#roadmapdomain

fis 中由于资源合并问题,所有路径都是绝对路径,所以这块暂时只能用这种方式来处理了。

@flyingzl
Copy link
Author

flyingzl commented Sep 9, 2015

加上domain只是缓解了一下而已,是否可以在#require输出时,可以有参数配置上应用上下文就好了。

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

No branches or pull requests

2 participants