My codes folders and files like this, you never know how many sub folders in it:
js/sub1/a.js js/sub2/b.js js/sub3/sub31/c.js js/sub4/sub41/sub411/d.js
Here is part of the Gruntfile.js:
grunt.initConfig({ watch: { src: { files: ['js/*.js'], tasks: [] } } });
Grunt can't watch the changes of my all JavaScript files by using 'js/*.js'
. So how to write the correct file path expression?
Enter the main folder you want to see and Ctrl + B . That will list all files within the main folder and all of its subfolders.
Open Windows Explorer. Select Organize / Folder and Search options. Select the Search Tab. In the How to search section, select the Include subfolders in search results when searching in file folders option.
A subfolder is a folder stored inside another folder. Subfolders help you organize your files more completely. Each subfolder should be used to store files related to each other. For example, you might have one folder for files related to a job search.
Per the official documentation on file globbing, to watch for changes for files of a certain file type in the directory path and its subdirectories, you'll want:
files: ['js/**/*.js']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With