How to prevent browser scrolling requiring all pads?

I use Browsize and Browsify-shim in a project, run through gulp with gulp -browserify.

    gulp.src(['./resources/js/main.js'])
    .pipe(browserify({
        shim: {
            angular: {
                path: './node_modules/angular/angular.js',
                exports: 'angular'
            },
            'angular-animate': {
                path: './node_modules/angular-animate/angular-animate.js',
                exports: 'ngAnimate',
                depends: {
                    angular: 'angular',
                    jQuery: 'jQuery'
                }
            },
            [...]
        }
    }))
    .pipe(concat('app.js'))
    .pipe(gulp.dest('./web/js'));

This setting works fine and, for the most part, as intended. However, Browserify will always include all encrypted libraries in the assembly, even if none of them is called require ().

Documentation does not seem to exist on this topic. Is there any way to prevent this? It seems to me very controversial for me - the assembly should contain only what I really require.

(Update: I installed angular and other libraries using napa / npm)

+3
source share
1 answer

Browserify, (, , , , "" ) . , - require() , , , module.exports , , , , node.:)

, , , , , , , require() .

, , - gulp.env, .

0

All Articles