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

使用 gulp 实现兼容 seajs 和 requirejs 的打包工具 #25

Closed
nimoc opened this issue Apr 21, 2015 · 3 comments
Closed

使用 gulp 实现兼容 seajs 和 requirejs 的打包工具 #25

nimoc opened this issue Apr 21, 2015 · 3 comments

Comments

@nimoc
Copy link
Owner

nimoc commented Apr 21, 2015

基本思路:

gulp.src('src/js/page/a.js')
       .pipe(build())
       .pipe(gulp.dest())
// src/js/page/a.js
seajs.use(['jquery',
    'arale/tip/1.2.2/tip',
    'rain/daterange/0.0.1/daterange',
    'gallery/webuploader/0.1.5/webuploader',
    'arale/validator/0.9.7/validator',
    'arale/dialog/1.3.0/dialog'
    ],
    function (a,b,c,d) {
// .. code  ... 
})

---- 以上代码会编译成 ------

// dist/js/page/a.js
(function(){
defined('jquery/1.0.1/jquery')....
defined('arale/tip/1.2.2/tip')....
defined('arale/dialog/1.3.0/dialog')...
// ... code ...

})()

参考的 spm3 实时开发方式

@nimoc nimoc changed the title 更新 gulp-use red 更新 gulp-useref Apr 21, 2015
@nimoc nimoc changed the title 更新 gulp-useref 使用 gulp 实现兼容 seajs 和 requirejs 的打包工具 Apr 21, 2015
@nimoc nimoc mentioned this issue Apr 21, 2015
@nimoc
Copy link
Owner Author

nimoc commented Apr 22, 2015

spm 3.6 能很好地应对各种类型的开发需求,不需要重复造轮子。(而spmjs.io 提供了生态系统)

@nimoc nimoc closed this as completed Apr 22, 2015
@lichunqiang
Copy link

求分享

@nimoc
Copy link
Owner Author

nimoc commented Apr 23, 2015

@lichunqiang
spm 教程就是你 star 过的这个项目 https://github.com/spmjs/docs

使用spmjs.io 已有的模块进行开发时非常方便,方便程度与用 npm 差不多了。

如果 spmjs.io 没有某些模块需要自己 spm publish


我们团队目前对于模块化开发的解决方案是:
不特别在意 HTTP请求数的使用 服务器在线 combo 请参考这个项目
在意 HTTP请求数的使用 spmv3.6 本地打包

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants