安装
npm install gulp-autoprefixer
yarn add gulp-autoprefixer
pnpm add gulp-autoprefixer
bun add gulp-autoprefixer
README

gulp-autoprefixer

Prefix CSS with Autoprefixer

Issues with the output should be reported on the Autoprefixer issue tracker.

Install

npm install --save-dev gulp-autoprefixer

Usage

import gulp from 'gulp';
import autoprefixer from 'gulp-autoprefixer';

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

API

autoprefixer(options?)

options

Type: object

See the Autoprefixer options.

Source Maps

Use gulp-sourcemaps like this:

import gulp from 'gulp';
import sourcemaps from 'gulp-sourcemaps';
import concat from 'gulp-concat';
import autoprefixer from 'gulp-autoprefixer';

export default () => (
	gulp.src('src/**/*.css')
		.pipe(sourcemaps.init())
		.pipe(autoprefixer())
		.pipe(concat('all.css'))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('dist'))
);

Tip

If you use other PostCSS based tools, like cssnano, you may want to run them together using gulp-postcss instead of gulp-autoprefixer. It will be faster, as the CSS is parsed only once for all PostCSS based tools, including Autoprefixer.

版本列表
10.0.0 2025-09-11
9.0.0 2023-11-02
8.0.0 2021-05-29
7.0.1 2019-10-04
7.0.0 2019-08-18
6.1.0 2019-04-19
6.0.0 2018-08-26
5.0.0 2018-02-28
4.1.0 2017-12-29
4.0.0 2017-05-08
3.1.1 2016-08-13
3.1.0 2015-10-15
3.0.2 2015-09-23
3.0.1 2015-09-04
3.0.0 2015-09-04
2.3.1 2015-06-03
2.3.0 2015-05-15
2.2.0 2015-04-23
2.1.0 2015-01-14
2.0.0 2014-11-16
1.0.1 2014-09-21
1.0.0 2014-09-08
0.0.10 2014-08-28
0.0.9 2014-08-24
0.0.8 2014-06-30
0.0.7 2014-04-07
0.0.6 2014-02-01
0.0.5 2014-01-26
0.0.4 2014-01-12
0.0.3 2014-01-01
0.0.2 2013-12-21
0.0.1 2013-12-01