Reputation: 421
I'm reading the article Debugging ES6 in Visual Studio Code and find a syntax in launch.json
file that I don't quite understand.
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch App.js",
"program": "${workspaceRoot}/src/app.js",
"outFiles": [ "${workspaceRoot}/.compiled/**/*.js" ]
}
}
"outFiles": [ "${workspaceRoot}/.compiled/**/*.js" ]
What does the **
(two stars) represent? Also, does *.js
match filname.js.map
beside matching filename.js
? I am not sure if this kind of pattern relates to regexr.
Upvotes: 0
Views: 87
Reputation: 1367
This is not a regex (because dot in ".js" does not look like it matches any character).
This is kind of fancy wildcard for a filename:
${workspaceRoot}
- some environmental variable /.compiled
- exact name of folder (e.g. for generated code)/**
- any set of nested folders/*.js
- any file with js
extension at path specified before Also, does *.js match filname.js.map beside matching filename.js?
I assume that it does not, only filename.js
.
Upvotes: 2
Reputation: 2053
the ** (double-glob) means that it will search in any number of subdirectories. For example,
a/**/b
will match
a/a/b
a/c/b
a/c/a/b
and so on.
Upvotes: 1