Gulp自动前缀不带前缀

问题描述 投票:0回答:1

我不确定为什么,但是Autoprefixer不会向已编译的CSS添加任何前缀。有人知道吗?

这是我的gulpfile.js

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

exports.default = () => (
    gulp.src('css/styles.css')
        .pipe(autoprefixer({
            cascade: false
        }))
        .pipe(gulp.dest('dist'))
);

gulp- vCLI版本:2.2.1本地版本:4.0.2

谢谢!

gulp autoprefixer
1个回答
0
投票

确实!您可能使用的CSS规则在当前配置中不需要前缀。

input::placeholder { color: red; }

结果

input::-moz-placeholder {
        color: red;
}
input:-ms-input-placeholder {
        color: red;
}
input::-ms-input-placeholder {
        color: red;
}
input::placeholder {
        color: red;
}

检查browserslist是否有自定义前缀规则

© www.soinside.com 2019 - 2024. All rights reserved.