为我的项目构建的bower_components太大

时间:2017-07-05 20:24:05

标签: javascript angularjs node.js bower gulp-uglify

在我使用此节点js代码

构建项目之后
gulp.task('build-css-js-files', function() {
    return  gulp.src('app/*.html')
        .pipe(useref())
        .pipe(gulpif('*.js', uglify()))
        .pipe(gulp.dest(paths.dist));
});

它会返回此警告消息:

[21:10:48] Starting 'build-css-js-files'...
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
[21:14:10] Finished 'build-css-js-files' after 3.35 min

请问有什么方法可以将构建过程分成两个或更多个seqments。为了防止我有一个非常大的vendor.js文件。

这是我的凉亭组件,我希望分成两部分:

<!-- build:js js/vendors.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
<script src="bower_components/angular-google-gapi/dist/angular-google-gapi.min.js"></script>
<script src="bower_components/jquery-knob/js/jquery.knob.js"></script>
<script src="bower_components/jquery-slimscroll/jquery.slimscroll.js"></script>
<script src="bower_components/fastclick/lib/fastclick.js"></script>
<script src="bower_components/angular-loading-bar/build/loading-bar.js"></script>
<script src="bower_components/trix/dist/trix.js"></script>
<script src="bower_components/angular-trix/dist/angular-trix.js"></script>
<script src="bower_components/angular-ui-select/dist/select.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-tag/dist/angular-tag.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/angular-button-spinner/dist/angular-button-spinner.js"></script>
<script src="bower_components/rangy/rangy-core.js"></script>
<script src="bower_components/rangy/rangy-classapplier.js"></script>
<script src="bower_components/rangy/rangy-highlighter.js"></script>
<script src="bower_components/rangy/rangy-selectionsaverestore.js"></script>
<script src="bower_components/rangy/rangy-serializer.js"></script>
<script src="bower_components/rangy/rangy-textrange.js"></script>
<script src="bower_components/textAngular/dist/textAngular.js"></script>
<script src="bower_components/textAngular/dist/textAngular-sanitize.js"></script>
<script src="bower_components/textAngular/dist/textAngularSetup.js"></script>
<script src="bower_components/jquery-ui/jquery-ui.js"></script>
<script src="bower_components/angular-ui-sortable/sortable.js"></script>
<script src="bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"></script>
<script src="bower_components/pdfmake/build/pdfmake.js"></script>
<script src="bower_components/pdfmake/build/vfs_fonts.js"></script>
<script src="bower_components/angular-bootstrap-calendar/dist/js/angular-bootstrap-calendar-tpls.js"></script>
<script src="bower_components/rrule/lib/rrule.js"></script>
<script src="bower_components/jquery-mousewheel/jquery.mousewheel.js"></script>
<script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
<script src="bower_components/fullcalendar/dist/fullcalendar.js"></script>
<!-- endbower -->
<!-- endbuild -->

0 个答案:

没有答案