Skip to content

Commit f27d490

Browse files
committed
Improve explanatory comment
1 parent 41ff1c8 commit f27d490

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/config/parse-runtime.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ module.exports = function(argv, cwd) {
8787

8888
const partialConfig = babel.loadPartialConfig({
8989
/*
90-
* This is a small mystery. Even if we set the cwd & root
91-
* options, deep in babel, if the filename option is not
92-
* set, then it doesn't see the "cwd" directory as a valid
93-
* directory where it should look for the .babelrc file.
94-
* The fact that this is set to webpack.config.js is not
95-
* significant at all - you could even invent a filename.
96-
* However, as I'm not sure the side effects (the filename
97-
* option is documented as "for error messages"), we're
98-
* setting it to a realistic filename.
90+
* There are two types of babel configuration:
91+
* - project-wide configuration in babel.config.* files
92+
* - file-relative configuration in .babelrc.* files
93+
* or package.json files with a "babel" key
94+
*
95+
* To detect the file-relative configuration we need
96+
* to set the following values. The filename is needed
97+
* for Babel as an example so that it knows where it
98+
* needs to search the relative config for.
9999
*/
100100
root: cwd,
101101
cwd: cwd,

0 commit comments

Comments
 (0)