I am trying to minify angularjs and the route files using gulp
var files = [
'node_modules/angular/angular/angular.js',
'node_modules/angular-route/angular-route.js'
]
gulp.task('libs', function () {
return gulp.src(files)
.pipe(concat('libs.js'))
.pipe(gulp.dest('resources/assets/build'))
.pipe(ngAnnotate())
.pipe(uglify({
mangle: false
}))
.pipe(gulp.dest('public/js'));
});
After minificaton i got the following error in my console
Uncaught TypeError: Cannot read property 'module' of undefined
I've tried so many questions related to my issue,but that didn't solved my issue
gulp version:3.9.1
gulp uglify version:^3.0.0
Scripts
<script src="{{asset('js/libs.js')}}" ></script>
<script src="{{asset('js/scripts.js')}}" ></script>