是否可以从NPM获取供应商脚本(如jQuery,react)并将所有这些脚本连接到供应商中。js与Gulp一起使用
require('jquery')
例如?
我想做的是这样的事情:
var gulp = require('gulp');
var concat = require('gulp-concat');
var jquery = require('jquery');
var lodash = require('lodash');
var react = require('react');
var reactDom = require('react-dom');
var reactBootstrap = require('react-bootstrap');
gulp.task('default', function() {
gulp.src([jquery, lodash, react, reactDom, reactBootstrap])
.pipe(gulp.concat('vendor.js'))
.pipe(gulp.dest('./local/script'));
});