Code Monkey home page Code Monkey logo

gulp-seajs-combo's People

Contributors

chenmnkken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gulp-seajs-combo's Issues

无法解析css加载

打包后生成的js包含,
var Overlay = require('overlay');
require('dialog.css');
但是css文件未加载

關於map配置的問題

我有很多Widget內的公共JS在Static調用,當合併Static內的JS時就會發現合併不同的JS,就需要不斷的配置seajsCombo里的map,而且有很多需要重複配置,是否可以讓seajsCombo讀取seajs.config內的配置?
20150512104212

一个文件夹下,两个module并没有依赖关系,但执行combo后却合并到了一起

比如文件目录如下

src/               
  |-- a           
  |   |-- a.js
  |   `-- b.js
  `-- b 
      `-- bb.js

b.js 依赖 bb.js

gulp代码如下

var gulp = require( 'gulp' ),
    seajsCombo = require( 'gulp-seajs-combo' );

gulp.task( 'seajscombo', function(){
    return gulp.src( 'src/js/a/*.js' )
        .pipe( seajsCombo() )
        .pipe( gulp.task('build/js') );
}); 

结果是
合并后,
a.js 中只有自己的一个module,这个是正常的
但是b.js中不仅有依赖的bb.js的module,a.js的module也被合并进来了
a.js 和 b.js 没有任何依赖关系啊,为什么会这样

id问题导致?

我的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问题,请问怎么解决?

模块依赖解析函数存在bug

在使用过程中,发现存在一些特殊情况,combo对模块的依赖解析出错。
当标准的seajs模块中存在seajs.use调用时,依赖解析会跳去解析seajs.use的模式

defind(function(require, exports, module) {
    var $ = require('jQuery');
    function doSomething() {
        seajs.use('http://hm.baidu.com/h.js');
    }
})

src输入文件夹时会出问题

当源地址不是一个文件而是文件夹的时候,合并出来的结果有问题,会重复合并。原因是入口的o变量,被后面的闭包持久化了

向刀哥报告一个js代码文件内容解析的bug

/*
 if (location.href.indexOf("?dev") > 0) {
     seajs.use("./src/a", function () {
        console.log(arguments);
     });
 }
*/
seajs.use("./src/a", function () {
    console.log(arguments);
});

以上代码在执行gulp-seajs-combo/index.jspullDeps( options, rDeps, item )会报错,去掉注释中的if条件就没问题,我想应是rDeps正则匹配问题。origId在被赋值成?dev时代码粗bug了。

DEMO代码运行失败了!

var gulp = require( 'gulp' ),
seajsCombo = require( 'gulp-seajs-combo' );

gulp.task('default', function() {

}) ;
gulp.task( 'seajs', function(){
return gulp.src( 'resources/assets/js/main.js' )
.pipe( seajsCombo({'ignore':['wx']}) )
.pipe( gulp.task('public/js') );
});

[15:19:18] Using gulpfile ~/www/vhost/wgjv2/gulpfile.js
[15:19:18] Starting 'seajs'...
[15:19:18] Finished 'seajs' after 8.85 ms
[15:19:18] gulp-seajs-cmobo error: undefined is not a function
TypeError: undefined is not a function
at write (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/stream_readable.js:664:5)
at DestroyableTransform.emit (events.js:104:17)
at emitReadable
(/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:448:10)
at emitReadable (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:444:5)
at readableAddChunk (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:187:9)
at DestroyableTransform.Readable.push (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:149:10)
at DestroyableTransform.Transform.push (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:145:32)
at afterTransform (/home/bluse/www/vhost/wgjv2/node_modules/gulp-seajs-combo/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:101:12)

请问运用该插件合并模块后,需要手动修改html中的js地址吗?

谢谢您分享开发的插件,很好用,但是小弟有个问题,劳烦您给解答一下。
如题,有没有简便的方式,项目中不同的html用的js路径不同,不可能全部手动修改html吧。
我的想法是用压缩合并后,输出到和原来的文件相同目录结构的文件夹,比如原来是assets/a.js,合并压缩输出到,build/assets/a.js,这样我只需要在seajs-config中配置就可以实现不同的文件加载。请问如何实现输出时把原来的目录也输出过来?提前感谢您的回答。

能不能把seajs也加载进来

能不能把seajs,也加载进来,像这样seajs.use("./static/seajs");
我试下 了下,可以加载进来,只是顺序不对

建议作者可以在配置中自己配置base和paths,而不是让程序去读取seajs.config

建议作者可以在seajscombo配置中,添加可以自己配置base和paths,而不是让程序去读取seajs.config,因为我在使用过程中总是因为路径匹配导致好多错误。希望可以以当前gulpfile.js目录为基础目录,然后所有的base、paths,以及其他js文件都是基于此路径,(当然,原先以相对路径require的js文件,相对路径配置),这样可以避免好多问题。感谢作者的付出,往采纳!

require压缩报错

代码中是这样require一个模块:
Hogan.compile(require("./template"))

但是压缩后:
Hogan.compilerequire('template'))

压缩后直接报错。
然后改为:var template = require("./template")方式压缩即可。
如此看来,插件是不支持非变量方式的require。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.