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

模块id #4

Open
XIAOGUIGUI opened this issue Feb 5, 2015 · 3 comments
Open

模块id #4

XIAOGUIGUI opened this issue Feb 5, 2015 · 3 comments

Comments

@XIAOGUIGUI
Copy link

var transport = require('gulp-seajs-transport') ;怎么给构建文件添加id前缀,grunt可以设置idleading ,gulp呢?

@riskers
Copy link

riskers commented Feb 6, 2015

seajs构建的感想:
这一周以来一直在搞各种工具,包括Tmod让artTemplate外置,还有Grunt、Gulp构建seajs等等。其实,seajs的构建工具构建过程以后不能用的原因就是moduleID和URL不匹配!
比如:

seajs.use('script/main')
而main.js经过transport工具构建以后变成:
define('main',[],function(){
    ...
})

就算是这样,都是不能使用的,因为seajs.use的URL(script/main)和main模块的moduleID(main)不匹配!只能像本文一样使用map来映射:本来加载 script/main.js 而现在加载 script/dist/main.min.js

 ['script/main.js','script/dist/main.min.js']

这样就能保证URL和moduleID的一致了~
坑呢~~~

@guilipan
Copy link
Owner

@XIAOGUIGUI idleading的需求其实很不常见,因此未加,在seajs的config的时候你可以配置base

@guilipan
Copy link
Owner

@riskers seajs的构建确实有很多问题,有时候为了兼容cmd,需要开发很多插件,不过也要看具体的业务场景合理使用

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

3 participants