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

模板路径alias #18

Open
zhang6464 opened this issue Nov 24, 2014 · 0 comments
Open

模板路径alias #18

zhang6464 opened this issue Nov 24, 2014 · 0 comments

Comments

@zhang6464
Copy link

发现在加了text!前缀后,后面跟的就只能是绝对路径,而不能是一个alias了,或者是我的使用问题?

例如:
seajs.config({
alias: {
'view::search': 'js/views/search.js'
}
});

之后require('text!view::serach')就会转化为base/view::search,而没有替换alias。

后来查看了下源代码,发现是在id后面加了#后缀,以标识插件。
那么,hack一下,
seajs.config({
alias: {
'view::search#': 'js/views/search.js'
}
});

这样再require('text!view::serach')就能正常转换了。

我希望可以实现类似

seajs.config({
alias: {
'view::search': text!'js/views/search.js'
}
});
这样的效果,每次只需要require('view::serach')即可,但是代码里是检测的id,改起来不怎么容易。
不知有什么好的解决办法么?

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

1 participant