The question may be stupid, but there is such a problem: I have 2 folders src and dist . In one source, which I edit, in the other that at the output after the gulp collector. I want to use less , installed the gulp-less plugin in order to compile to css on output, but it turns out that the output compiles the file and turns into a css file, but the connection line in index.html does not change and the path leads to a file that is not

gulp file

var gulp = require('gulp'); var less = require('gulp-less'); gulp.task('less', function() { return gulp.src('src/style.less') .pipe(less()) .pipe(gulp.dest('dist')) }) gulp.task('html', ['less'], function() { return gulp.src('src/index.html') .pipe(gulp.dest('dist')) }) 

markup

 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <link rel="stylesheet" type="text/css" href="style.less" /> </head> <body> <div class ="header"> <div class="header__block"> Primarily, in the Middle East (especially the Ottoman Empire), a divan was a long seat formed of a mattress laid against the side of the room, upon the floor or upon a raised structure or frame, with cushions to lean against. </div> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> </body> </html> 

I hope correctly formulated the question

  • 2
    The option to immediately write dist/style.css instead of style.less does not fit? - Vladimir Gamalyan
  • immediately register style.css in index.html, and to immediately watch the changes I recommend browser-sync or, use the plugin gulp-replace npmjs.com/package/gulp-replace - HamSter
  • Ie to connect less.js it is necessary? I thought cleanly with the help of the galp plugin - Artem Palamarchuk
  • @ArtemPalamarchuk use my development github.com/1000tech/web-starter-kit . There, by default, interaction is already configured. - Vadizar

0