Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Requirejs Gulp:创建文件夹中每个文件的数组_Requirejs - Fatal编程技术网

Requirejs Gulp:创建文件夹中每个文件的数组

Requirejs Gulp:创建文件夹中每个文件的数组,requirejs,Requirejs,我正在尝试创建一个gulp任务,该任务将扫描文件夹中的所有文件,并创建这些文件的数组。我想自动化一些require js的东西,并且我想将该数组用作类的依赖项数组 在一个gulp任务中,我想为文件夹中的每个文件创建一个数组。有办法吗 到目前为止,我已经尝试做了几件事,这是我的最新尝试: gulp.src(['app/**/*.js']) .pipe(fileNames('javascript')); gulp.src('`enter code here`app.js')

我正在尝试创建一个gulp任务,该任务将扫描文件夹中的所有文件,并创建这些文件的数组。我想自动化一些require js的东西,并且我想将该数组用作类的依赖项数组

在一个gulp任务中,我想为文件夹中的每个文件创建一个数组。有办法吗

到目前为止,我已经尝试做了几件事,这是我的最新尝试:

gulp.src(['app/**/*.js'])
    .pipe(fileNames('javascript'));        

gulp.src('`enter code here`app.js')
    .pipe(gulpReplace('EVERY_FILE', JSON.stringify(fileNames.get('appjs', 'all'))))
    .pipe(gulp.dest('app'))
我试图在这里使用“gulp文件名”,但它就是不起作用。它应该替换app.js文件中的“EVERY_FILE”字符串


想知道是否有办法用gulp实现这一点。

我设法解决了“main bower files”包的问题