1 year ago

#13416

test-img

RS17

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.

javascript

gruntjs

grunt-contrib-watch

grunt-contrib-uglify

grunt-contrib-concat

0 Answers

Your Answer

Accepted video resources