This topic contains 3 replies, has 2 voices, and was last updated by Sean Sean 2 years, 1 month ago.

"gulp minify" not updating assets/*/min.css


  • piciu
    Participant

    Posts: 3
    Member Reply #4617

    When i run “gulp sass” all JS/CSS are recompiled properly but next “gulp minify” doesn’t update their minified versions (only produces output to /html)

     

    So for example:

    /assets/global/css/components-md.css is updated but

    /assets/global/css/components-md.min.css is not.

     

    Moreover – in gulpfile.js there is only .pipe(gulp.dest(‘./html’) in minify task, so my question – what to do to recompile /assets/global/css/components-md.MIN.css, assets/plugins/bootstrap/css/bootstrapp.MIN.css, etc? 🙂

    • This topic was modified 2 years, 1 month ago by  piciu.
    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #4682

    Hi,

    Sorry for the late reply.

    To update the minified versions  you will need to run “gulp minify” task that will generated minified versions of css and js files.

    If you need any further clarifications please let us know.

    Thanks.


    piciu
    Participant

    Posts: 3
    Member Reply #4685

    Thanks for your replay but have you read my question at all? 🙂

    You’re suggesting to run “gulp minify” where I’ve just wrote that it doesn’t work as expected..? :/

    “gulp minify” compiles files to “/html” directory but I’m asking how to recompile minified versions in /assets/ directory.

    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #4707

    Hi :),

    Please replace minify task’s code with below one in gulpfile.js:

    //*** CSS & JS minify task

    gulp.task(‘minify’, function () {

    // css minify

    gulp.src([‘./assets/apps/css/*.css’, ‘!./assets/apps/css/*.min.css’]).pipe(minifyCss()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/apps/css/’));    gulp.src([‘./assets/global/css/*.css’,’!./assets/global/css/*.min.css’]).pipe(minifyCss()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/global/css/’));    gulp.src([‘./assets/pages/css/*.css’,’!./assets/pages/css/*.min.css’]).pipe(minifyCss()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/pages/css/’));        gulp.src([‘./assets/layouts/**/css/*.css’,’!./assets/layouts/**/css/*.min.css’]).pipe(rename({suffix: ‘.min’})).pipe(minifyCss()).pipe(gulp.dest(‘./assets/layouts/’));

    gulp.src([‘./assets/layouts/**/css/**/*.css’,’!./assets/layouts/**/css/**/*.min.css’]).pipe(rename({suffix: ‘.min’})).pipe(minifyCss()).pipe(gulp.dest(‘./assets/layouts/’));    gulp.src([‘./assets/global/plugins/bootstrap/css/*.css’,’!./assets/global/plugins/bootstrap/css/*.min.css’]).pipe(minifyCss()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/global/plugins/bootstrap/css/’));

    //js minify    gulp.src([‘./assets/apps/scripts/*.js’,’!./assets/apps/scripts/*.min.js’]).pipe(uglify()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/apps/scripts/’));    gulp.src([‘./assets/global/scripts/*.js’,’!./assets/global/scripts/*.min.js’]).pipe(uglify()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/global/scripts’));    gulp.src([‘./assets/pages/scripts/*.js’,’!./assets/pages/scripts/*.min.js’]).pipe(uglify()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/pages/scripts’));

    gulp.src([‘./assets/layouts/**/scripts/*.js’,’!./assets/layouts/**/scripts/*.min.js’]).pipe(uglify()).pipe(rename({suffix: ‘.min’})).pipe(gulp.dest(‘./assets/layouts/’));

    });

    Thanks.

Tagged: 

You must be logged in to reply to this topic.