注入npm依赖的吞咽

我使用gulp compilatorangular度。 我使用了bower依赖,我把它们全部移到了npm。 我有注入依赖脚本的问题。 这是我目前的注入代码。 如何更改wiredep到另一个库来处理npm注入,因为我有Uncaught ReferenceError:angular没有定义,var angular = require(angular)不起作用。 是否有任何简单的解决scheme注入npm的依赖脚本没有要求等? 如果不是这样,要求如何?

var injectStyles = gulp.src([ paths.tmp + '/serve/{app,components,lib}/**/*.css', paths.src + '/{app,components,lib}/**/*.css', '!' + paths.tmp + '/serve/app/vendor.css' ], {read: false}); var injectScripts = gulp.src([ paths.src + '/{app,components,lib}/**/*.js', paths.tmp + '/serve/build/*.js', '!' + paths.src + '/{app,components}/**/*.spec.js', '!' + paths.src + '/{app,components}/**/*.mock.js' ]).pipe($.angularFilesort()); var injectOptions = { ignorePath: [paths.src, paths.tmp + '/serve', paths.tmp + '/build'], addRootSlash: false }; var wiredepOptions = { directory: 'bower_components', exclude: [/bootstrap\.css/, /bootstrap\.css/, /foundation\.css/] }; return gulp.src(paths.src + '/*.html') .pipe($.inject(injectStyles, injectOptions)) .pipe($.inject(injectScripts, injectOptions)) .pipe(gulp.dest(paths.tmp + '/serve'));