Compile Less files in Sass Gulp task -
in projects have several files - sass, less & css. need solution on how compile , assemble everything. it important can determine order.
it may be, in area "plugins" (see source file) less file added. need support less?
here current setup (without less):
source file: (master.scss)
// variables @import "../scss/_variables.scss"; // frameworks // google font @import "https://fonts.googleapis.com/css?family=open+sans:400,300,600,700"; @import "https://fonts.googleapis.com/css?family=oswald:400,300,700)"; // icon font @import "bower_components/font-awesome/scss/font-awesome.scss"; // bootstrap @import "bower_components/bootstrap/scss/bootstrap.scss"; // plugins // swiper - modern touch slider @import "/bower_components/swiper/dist/css/swiper.min.css"; // lightgallery - customizable, modular, responsive, lightbox gallery @import "bower_components/lightgallery/src/sass/lightgallery.scss"; // bootstrap datetimepicker @import "bower_components/eonasdan-bootstrap-datetimepicker/src/sass/bootstrap-datetimepicker-build.scss"; // default // advanced custom mixins @import "../scss/_custom-mixins.scss"; // used elements, such quotes, lists etc. @import "../scss/_components.scss"; // default styles (main file) @import "../scss/_styles.scss"; // responsive styles @import "../scss/_responsive.scss";
gulp task:
gulp.task('sass', function() { gulp.src('src/scss/master.scss') .pipe(sourcemaps.init()) // shows in chrome developer tools, sass file contains style .pipe(plumber({ errorhandler: notify.onerror('<%= error.message %>') })) // error notification desktop .pipe(sass({}).on('error', sass.logerror)) // error text in terminal .pipe(cleancss({ relativeto: './bower_components', processimport: true })) .pipe(concat('master.css')) // merge sass & css 1 file .pipe(autoprefixer({browsers: ['last 3 versions'], cascade: false })) .pipe(cssnano()) // minify css .pipe(sourcemaps.write('.')) .pipe(gulp.dest('dist/css/')) // output folder .pipe(browsersync.stream()); // reload browse });
Comments
Post a Comment