我正在尝试使用gulp来加载jquery,但只使用我实际使用的模块,但是在这个过程中总是会破坏。我的gulp任务ATM是:
gulp.task('jqRJ', function() {
rjs({
generateSourceMaps: true,
baseUrl: './static/src/js-modules/vendor/jquery',
name: 'core',
out: 'jquery-3.1.1.js',
})
.pipe(srcmap.init({loadMaps: true}))
.pipe(srcmap.write(path.srcmaps))
.pipe(gulp.dest('./static/src/js-modules/vendor/jquery'));
});
我正在使用来自npm install jquery --save-dev
的jquery的文件夹/文件结构。 requirejs正确加载主jquery文件(define
依赖项),但它不加载其他依赖项(如core
或css
模块)。
任何想法我怎么能做到这一点?
谢谢!