I'm trying to generate a sourcemap and minify it but it is not working.
file position: test/test.less
output: file name test/test.less
map file test.css.map
compressed file test.min.css
When I load that file on browser then it is not loaded, but when I load bootstrap.css.map file then it is showing every css or less file.
var gulp = require( "gulp" ),
concat = require( "gulp-concat" ),
watch = require( "gulp-watch" ),
notify = require( "gulp-notify" ),
less = require( "gulp-less" ),
sourcemaps = require( "gulp-sourcemaps" );
var testCSSFile = "test/test.css";
var filePosition = "test";
gulp.task( "testCSS", function() {
gulp.src( testCSSFile )
.pipe( concat( "test.less" ) )
.pipe( sourcemaps.init() )
.pipe( less() )
.pipe( sourcemaps.write( ".") )
.pipe( gulp.dest(filePosition) )
.pipe( notify( "testCSS task completed." ) );
return gulp.src( testCSSFile )
.pipe( concat( "test.min.less" ) )
.pipe( less({
compress: true
}) )
.pipe( gulp.dest(filePosition) )
.pipe( notify( "testCSS task completed." ) );
});
gulp.task( "watch", function() {
gulp.watch( testCSSFile, [ "testCSS" ] );
});
gulp.task( "default", [
"testCSS",
"watch"
] );