chenmnkken / gulp-seajs-combo

seajs(CMD) Module combo pulgin for gulp
MIT License
53 stars 20 forks source link

id问题导致? #1

Closed LACERBA closed 9 years ago

LACERBA commented 9 years ago

我的gulpfile.js是这样写的 gulp.task('seajscombo', function() { gulp.src("static/module/*/.js") .pipe(seajsCombo()) .pipe(gulp.dest('dist/static/module')); });

生成的合并文件main.js是这样 define('main',['support','showanimation'],function(require,exports,moudle) {}); define('support',function(require, exports, moudule) {}); define('showanimation',['support'],function(require,exports,moudule) {});

但是执行不了,网上查貌似是id问题,请问怎么解决?

chenmnkken commented 9 years ago

seajs.use( 'main' ) 你是怎么use这个模块的呢

chenmnkken commented 9 years ago

另外 gulp.src 中要设置具体的文件路径

LACERBA commented 9 years ago

seajs.config({ base: "../dist/", alias:{ '':'static/module/' } }); seajs.use("static/module/game/main");

chenmnkken commented 9 years ago

看下这2个测试文件的对比就知道了 build前: https://github.com/chenmnkken/gulp-seajs-combo/blob/master/test/src/f.js build后 https://github.com/chenmnkken/gulp-seajs-combo/blob/master/test/build/f.js

还有对seajs.config的处理规则 build前: https://github.com/chenmnkken/gulp-seajs-combo/blob/master/test/src/m.js build后: https://github.com/chenmnkken/gulp-seajs-combo/blob/master/test/build/m.js

LACERBA commented 9 years ago

还有一个问题啊,如图 gulp @chenmnkken 感觉这个更严重啊。。。

chenmnkken commented 9 years ago

合并后的模块可以不用严格按照顺序来的,seajs内部会处理,可以正常运行。