@nikolay_akhmetyanov
Front-end developer

PostCss плагин postcss-easy-import не импортирует стили. Почему?

Не импортируются стили

var 	        gulp          = require('gulp'),
		gutil         = require('gulp-util' ),
		pug        	  = require('gulp-pug'),
		postcss 	  = require('gulp-postcss'),
		assets  	  = require('postcss-assets'),
		cssnext		  = require('postcss-cssnext'),
	    sourcemaps 	  = require('gulp-sourcemaps'),
	    reporter 	  = require('postcss-browser-reporter'),
	    importcss 	  = require('postcss-easy-import'),
	    rucksack 	  = require('rucksack-css'),
	    lost 		  = require('lost'),
	    stylelint	  = require('stylelint'),
	    config		  = require('./stylelint.config.js'),
	    plumber 	  = require('gulp-plumber'),
	    browsersync   = require('browser-sync'),
		concat        = require('gulp-concat'),
		uglify        = require('gulp-uglify'),
		rename        = require('gulp-rename'),
		notify        = require("gulp-notify"),
		rsync         = require('gulp-rsync');

gulp.task('browser-sync', function() {
	browsersync({
		server: {
			baseDir: 'app'
		},
		notify: false,
		// open: false,
		// tunnel: true,
		// tunnel: "projectmane", //Demonstration page: http://projectmane.localtunnel.me
	})
});

var paths = {
			pugSourse: 'dev/',
			pugDestination: 'app/',
			cssSource: 'dev/',
  			cssDestination: 'app/css/'
		};

gulp.task('pug', function buildHTML() {
	return gulp.src(paths.pugSourse + '*.pug')
	.pipe(plumber({
		errorHandler: notify.onError(function(err){
			return {
				title: 'Pug',
				message: err.message
			}
		})
	}))
	.pipe(pug({
		pretty: true
	}))
	.pipe(gulp.dest(paths.pugDestination))
	.pipe(browsersync.reload( {stream: true} ))
});

gulp.task('css', function() {
  return gulp.src(paths.cssSource + '*.css')
    .pipe(sourcemaps.init())
    .pipe(postcss([
      importcss(),
      cssnext(),
      rucksack(),
      assets({ loadPaths: ['app/img/bg/']}),
      lost(),
      stylelint(config),
      reporter()
    ]))
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest(paths.cssDestination));
});

gulp.task('js', function() {
	return gulp.src([
		'app/libs/jquery/dist/jquery.min.js',
		'app/js/common.js', // Always at the end
		])
	.pipe(concat('scripts.min.js'))
	// .pipe(uglify()) // Mifify js (opt.)
	.pipe(gulp.dest('app/js'))
	.pipe(browsersync.reload({ stream: true }))
});

gulp.task('rsync', function() {
	return gulp.src('app/**')
	.pipe(rsync({
		root: 'app/',
		hostname: 'username@yousite.com',
		destination: 'yousite/public_html/',
		// include: ['*.htaccess'], // Includes files to deploy
		exclude: ['**/Thumbs.db', '**/*.DS_Store'], // Excludes files from deploy
		recursive: true,
		archive: true,
		silent: false,
		compress: true
	}))
});

gulp.task('watch', ['pug', 'css', 'js', 'browser-sync'], function() {
	gulp.watch(paths.pugSourse + '**/*.pug', ['pug']);
	gulp.watch(paths.pugSourse + '**/*.css', ['css']);
	gulp.watch('app/*.html', browsersync.reload)
});

gulp.task('default', ['watch']);
  • Вопрос задан
  • 34 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через TM ID
Похожие вопросы
Biganto Москва
от 130 000 до 130 000 руб.
Soft Media Int. Пенза
от 125 000 до 225 000 руб.
15 авг. 2018, в 23:38
300 руб./за проект
15 авг. 2018, в 22:39
60000 руб./за проект
15 авг. 2018, в 21:18
30000 руб./за проект