Skip to content

Commit 8937962

Browse files
authored
Update the JSDoc of configureBabel to warn about .babelrc and node_modules
Babel supports 2 different types of config files: - .babelrc stops at package boundaries - babel.config.* applies to the whole project, including node_modules Once node_modules is not excluded anymore in the babel-loader configuration, this distinction matters.
1 parent a7d76ee commit 8937962

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,14 +931,19 @@ class Encore {
931931
* determines which files and folders should not be
932932
* processed by Babel (https://webpack.js.org/configuration/module/#condition).
933933
* Can be used even if you have an external Babel configuration
934-
* (a .babelrc file for instance)
934+
* (a babel.config.json file for instance)
935+
* Warning: .babelrc config files don't apply to node_modules. Use
936+
* babel.config.json instead to apply the same config to modules if
937+
* they are not excluded anymore.
935938
* Cannot be used if the "includeNodeModules" option is
936939
* also set.
937940
* * {string[]} includeNodeModules
938941
* If set that option will include the given Node modules to
939942
* the files that are processed by Babel.
940943
* Can be used even if you have an external Babel configuration
941-
* (a .babelrc file for instance).
944+
* (a babel.config.json file for instance).
945+
* Warning: .babelrc config files don't apply to node_modules. Use
946+
* babel.config.json instead to apply the same config to these modules.
942947
* Cannot be used if the "exclude" option is also set
943948
* * {'usage'|'entry'|false} useBuiltIns (default=false)
944949
* Set the "useBuiltIns" option of @babel/preset-env that changes

0 commit comments

Comments
 (0)