A
A
Artur Karapetyan2017-05-23 13:00:28
JavaScript
Artur Karapetyan, 2017-05-23 13:00:28

Gulp-uglify and fotorama?

gulpfile.js :

var gulp           = require('gulp'),
    gutil          = require('gulp-util' ),
    sass           = require('gulp-sass'),
    browserSync    = require('browser-sync'),
    concat         = require('gulp-concat'),
    uglify         = require('gulp-uglify'),
    cleanCSS       = require('gulp-clean-css'),
    rename         = require('gulp-rename'),
    del            = require('del'),
    imagemin       = require('gulp-imagemin'),
    cache          = require('gulp-cache'),
    autoprefixer   = require('gulp-autoprefixer'),
    ftp            = require('vinyl-ftp'),
    notify         = require("gulp-notify");

// Скрипты проекта
gulp.task('js', function() {
  return gulp.src([
    'assets/app/libs/jquery/dist/jquery.min.js',
    'assets/app/libs/fotorama/fotorama.js',
    'assets/app/libs/mmenu/dist/jquery.mmenu.min.js',
    'assets/app/libs/owl/owl.carousel.min.js',
    'assets/app/libs/magnific-popup/dist/jquery.magnific-popup.min.js',
    'assets/app/libs/animate/animate-css.js',
    'assets/app/libs/flatpickr/dist/flatpickr.min.js',
    'assets/app/libs/flatpickr/dist/l10n/ru.js',
    'assets/app/libs/jquery.maskedinput/dist/jquery.maskedinput.min.js',
    'assets/app/js/common.js', // Всегда в конце
    ])
  .pipe(concat('scripts.min.js'))
  .pipe(uglify())
  .pipe(gulp.dest('assets/app/js'))
  .pipe(browserSync.reload({stream: true}));
});

When connecting fotorama, an error is generated that the createElement function was not found in the final minification file. If you do not minify JS, then everything works fine. What to do?
UPD:
Here is the site: https://architawer.github.io/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-23
@architawr

Why not take the already minified one?
https://github.com/ai/fotoramajs/blob/master/vendo...
cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/foto...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question