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路径中的一个字段么? #92

Open
xiaoshuimao opened this issue Jan 22, 2015 · 2 comments
Open

Comments

@xiaoshuimao
Copy link

var $ = require('$');

var Handlebars = require('cmd/handlebars/2.0.0/handlebars');

a.js

"options": {
    "alias": {
      "$": "lib/jquery/1.11.1/jquery",
      "cmd": "lib/cmd-plugins/"
    }
  }

packpage.json

请问,我这边 require('cmd/handlebars/2.0.0/handlebars'); 这里的cmd能被别名替换么?或者有什么像seajs一样有path的配置项?

@popomore
Copy link
Member

没有,为何不直接 require('handlebars')

@xiaoshuimao
Copy link
Author

seajs.config({
 paths: {
   'cmd': 'lib/cmd-plugins'
 }

seajs.config

var $ = require('$');

var Handlebars = require('cmd/handlebars/2.0.0/handlebars');

a.js

是这个情况,我可能seajs那边会有这个path配置,正常use这个a.js没问题。(有类似很多的js使用了这个path变量)
然后我想通过这个transports插件来批量添加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

2 participants