gulp-autoprefixer not compiling CSS3

a 夏天 提交于 2019-12-11 20:13:59

问题


In my gulpfile.js

gulp.task('sass', function() {
  return gulp.src('sass/screen.scss')
    .pipe(sass())
    .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
    .pipe(gulp.dest('/'));
});

gulp.task('watch', function() {
    gulp.watch( 'sass/**/*.scss', ['sass'] );
});

1) Everything seems set up correctly. My main sass file is located at sass/screen.scss. I'm not sure why I have to redeclare the src of where to watch since that's already being established in the sass pipe.

2) I'm not sure if I have my autoprefixer setup correctly or what the exact arguments mean. For example, 'last 2 version' refers to safari 5, 4.9, 4.8? I can't find documentation on this.

In both cases, it doesn't seem like the autoprefixer is compiling to screen.css.

In my .scss I have some transitions, transformations, and box-shadows such as:

.shadow {
    box-shadow: #000 5px 5px 5px;
}

回答1:


It looks like you need to change your destination filename. Where do you want the compiled css to end up? If you want it in the current directory in a file named screen.css, then change gulp.dest('/') to gulp.dest('screen.css').



来源:https://stackoverflow.com/questions/22506171/gulp-autoprefixer-not-compiling-css3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!