[code]
Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.
…
[/code]
突然上記のようなエラーが出たので、解決方法をメモしておきます。
目次
- gulpfile.js の autoprefixer 設定を package.json へ変更する
- まとめ
gulpfile.js の autoprefixer 設定を package.json へ変更する
gulpfile.js にある以下のコードをコメントアウトし、package.json の最後尾へ記述します。
gulpfile.js
[code]
gulp.task(“scss”, function () {
return gulp.src(paths.src + ‘**/*.scss’)
.pipe(sass())
// .pipe(autoprefixer({
// browsers: [‘last 2 version’, ‘ie >= 11’, ‘Android >= 4.0’],
// cascade: false
// }))
.pipe(gulp.dest(paths.dest)); // 出力
});
[/code]
package.json
[code]
…
…
“dependencies”: {},
“browserslist”: [
“last 2 versions”,
“ie >= 11”,
“Android >= 4.0”
]
}
[/code]
まとめ
autoprefixer の設定を行なっている gulpfile.js があれば、上記の変更を行う必要があります。
sass コンパイルに gulp を利用している方にとって、autoprefixer は欠かせない存在だと思うので、しっかり対応しておいてください。
この記事がみなさんのお役に立ちましたら、下記「Share it」よりブックマークやSNSで共有していただければ幸いです。
