无需更改Gulp的类型:TypeError-“ path”参数必须是字符串,Buffer或URL类型之一。收到的类型对象

时间:2019-06-19 14:05:35

标签: gulp gulp-less

我正在努力减少工作量,但我一直在努力

   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));
    });

我不确定自己在做什么错。

0 个答案:

没有答案