我正在努力减少工作量,但我一直在努力
Error processing '/Users/XXX/project/assets/build-packages/example-file.less': TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type object
Details:
domainEmitter: [object Object]
domain: [object Object]
domainThrown: false
这是我Gulpfile的一部分(几乎是Readme的一个副本,我无法使用)
const gulp = require('gulp');
const gulpRename = require('gulp-rename');
const less = require('less');
const lessChanged = require('gulp-less-changed');
const OutputPath = './dist/styles';
const MinifiedExtension = '.min.css';
gulp.task('default', () => {
return gulp.src('./assets/build-packages/*.less')
.pipe(lessChanged({
getOutputFileName: file => gulpRename(file, { dirname: OutputPath, extname: MinifiedExtension })
}))
.pipe($.less())
.pipe(gulpRename({ extname: MinifiedExtension }))
.pipe(gulp.dest(OutputPath));
});
我不确定自己在做什么错。