Владимир Скибин, PS D:\sass> gulp serve
D:\sass\gulpfile.js:1
import babel from 'gulp-babel';
^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at execute (C:\Users\Администратор\AppData\Roaming\npm\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js:36:18)
at Liftoff.handleArguments (C:\Users\Администратор\AppData\Roaming\npm\node_modules\gulp-cli\index.js:201:24)
at Liftoff.execute (C:\Users\Администратор\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\liftoff\index.js:201:12)
PS D:\sass>
Владимир Скибин, заменил на этот код верно?
import babel from 'gulp-babel';
import concat from 'gulp-concat';
import del from 'del';
import gulp from 'gulp';
import uglify from 'gulp-uglify';
import browserSync from 'browser-sync';
Вы знаете ?
const gulp = require('gulp');
const sass = require('gulp-sass');
const plumber = require('gulp-plumber');
const autoprefixer = require('gulp-autoprefixer');
const browserSync = require('browser-sync').create();
const sourceMaps = require('gulp-sourcemaps');
gulp.task('sass', function () {
return gulp.src('scss/style.scss')
.pipe(plumber())
.pipe(sourceMaps.init())
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(sourceMaps.write())
.pipe(gulp.dest('build/css'))
.pipe(browserSync.reload({stream: true}));
});
gulp.task('html', function () {
return gulp.src('*.html')
.pipe(gulp.dest('build'))
.pipe(browserSync.reload({stream: true}));
});
gulp.task('serve', ['html', 'sass'], function () {
browserSync.init({
server: "build"
});
gulp.watch("scss/**/*.scss", ["sass"]);
gulp.watch("*.html", ["html"]);
});