RS17
RS17

Reputation: 813

How to exclude only *.spec files and include all other *.js files under a directory in grunt task?

I need to include all *.js files and exclude only *.spec.js files under a directory.

I tried the following ways, it's either including all js or excluding all js files

'built/code/js/libs/preact/**/!(*.spec).js') but it fails with the message syntax error near unexpected token `('.

If I do this way - 'built/code/js/libs/preact/**/!*.spec.js') it excludes all js files

If I add in 2 different lines like below it excludes all js files

('built/code/js/libs/preact/**/*.js' +
'built/code/js/libs/preact/**/!*.spec.js')

Please let me know if there's a way to exclude spec files and include all other js files.

Upvotes: 1

Views: 671

Answers (0)

Related Questions