개발(Web)/Web
[Gulp] ReferenceError: primordials is not defined
shinyelee
2021. 3. 8. 13:47
ReferenceError: primordials is not defined
방법 1. package.json 수정
,
"scripts": {
"preinstall": "npx npm-force-resolutions"
},
"resolutions": {
"graceful-fs": "4.2.3"
}
방법 2. gulpfile.js 업데이트
// 전략
gulp.task('images', gulp.series(function(done) {
return gulp.src('assets/images/*')
.pipe(imagemin())
.pipe(gulp.dest('assets/built/images/'))
done();
}));
gulp.task('css', gulp.series(function(done) {
var processors = [
easyimport,
customProperties,
colorFunction(),
autoprefixer({browsers: ['last 2 versions']}),
cssnano()
];
return gulp.src('assets/css/*.css')
.pipe(sourcemaps.init())
.pipe(postcss(processors))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('assets/built/'))
done();
}));
반응형