3

I have a main app folder with many subfolders, each with their own subfolders, etc, which along the way contain .js files.

I want to create a grunt task that concatenates all the .js files anywhere under this main top level folder, which is called src.

Is there anyway to do that?

Right now, I have

            cwd: '.',
            src: [
                'src/**/**/*.js',
                'src/**/**/**/*.js',
                'src/**/**/**/**/*.js',
            ],
            dest: 'dist/app/superapp.js'

but this doesn't account for all possible .js file locations. And if I add a new .js in some folder, I don't want to have to manually update the grunt task.

CodyBugstein
  • 21,984
  • 61
  • 207
  • 363

1 Answers1

5

According to the grunt docs, src/**/*.js is all you need here.

foo/**/*.js will match all files ending with .js in the foo/ subdirectory and all of its subdirectories.

starwed
  • 2,536
  • 2
  • 25
  • 39