1

i am quite new to autoprefixer, i did just like the documentation but when i type "gulp styles" into the terminal it did not create any file in the destination folder

here is my gulpfile.js code

const gulp = require('gulp');
const autoprefixer = require('gulp-autoprefixer');

gulp.task('styles', () =>
gulp.src('css/styles.css')
  .pipe(autoprefixer({
    browsers: ['last 2 versions'],
    cascade: false
  }))
  .pipe(gulp.dest('build'))
);
gulp.task('watch', function () {
  gulp.watch('css/styles.css', ['styles']);
});

and here is my css code

.container {
  display:flex;
  flex-direction:column;
  align-content:center;
  justify-content:center;
}

.box1 {
  flex:10 5 450px;
}

.box2 {
  flex:1 1 360px;
}

here is what my terminal looks like

peinearydevelopment
  • 11,042
  • 5
  • 48
  • 76
The Ace
  • 11
  • 3
  • I tried exactly your code and css and it worked as expected. Are you sure your gulpfile.js is at the same level as the css folder? – Mark Mar 28 '18 at 20:53
  • @Mark yes i put the gulpfile.js in the root of the files, just like the css folder – The Ace Mar 31 '18 at 09:11
  • @Mark i tried the gulp debugger and there isn't any file showing up – The Ace Mar 31 '18 at 09:36
  • So you have autoprefixer/css/styles.css and autoprefixer/gulpfile.js? And no error messages? And nothing in autoprefixer/build ? – Mark Apr 01 '18 at 01:36
  • @Mark yes i can also use the watch task without any problem but the styles task is not working – The Ace Apr 01 '18 at 13:01

0 Answers0