1、首先降低了gulp-autoprefixer的版本
"devDependencies": {
"babel-core": "^6.26.3",
"babel-plugin-transform-remove-strict-mode": "^0.0.2",
"babel-preset-env": "^1.7.0",
"del": "^6.0.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^6.0.0",
"gulp-babel": "^7.0.1",
"gulp-concat": "^2.6.1",
"gulp-htmlmin": "^5.0.1",
"gulp-minify-css": "^1.2.4",
"gulp-rev": "^9.0.0",
"gulp-rev-collector": "^1.3.3",
"gulp-uglify": "^3.0.2"
},
2.将browsers
重命名为overrideBrowserslist
gulp.task('style', function () {
return (
gulp
.src('./css/*.css')
.pipe(
autoprefix({
overrideBrowserslist: ['last 2 versions'],
cascade: false,
})
)
.pipe(minifyCss())
// .pipe(rev())
.pipe(gulp.dest('./build/css'))
.pipe(rev.manifest('rev-css-manifest.json'))
.pipe(gulp.dest('./build/css'))
)
})