Hi,
I am facing a problem of not being able to minify the popper and bootstrap 4 files js when included with Uglify.
It works if its only the boostrap. it takes it from the bower_components folder and minify it. but when I add the popper it stops working.
the code I have to minify is the following:
// Concatenates all files that it finds in the manifest
// and creates two versions: normal and minified.
// It's dependent on the jshint task to succeed.
gulp.task('scripts', ['jshint'], function () {
return gulp.src('./js/manifest.js')
.pipe(include())
.pipe(rename({basename: 'scripts'}))
.pipe(gulp.dest('./js/dist'))
// Normal done, time to create the minified javascript (scripts.min.js)
// remove the following 3 lines if you don't want it
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./js/dist'))
.pipe(notify({title: 'Javascript', message: 'scripts task complete'}));
//.pipe( livereload() );
});
on the manifest I have the following:
//= include ../bower_components/popper.js/dist/popper.js
//= include ../bower_components/bootstrap/dist/js/bootstrap.js
thank you in advance,
dist/popper.js
is an ES6 version, therefore uglifyJS cannot minify it. Change the path to dist/umd/popper.js
closed thanks to @sqal 馃憤
thank you so much for explaning this to me!
@sqal Worked thanks a lot 馃憤
Most helpful comment
dist/popper.js
is an ES6 version, therefore uglifyJS cannot minify it. Change the path todist/umd/popper.js