-
-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loadPartialConfig fails to clear the overrides/test/include/exclude fields from its result #642
Comments
I think here cause this issue. Here is my patch files: --- a/node_modules/babel-loader/lib/index.js
+++ b/node_modules/babel-loader/lib/index.js
@@ -79,12 +79,12 @@ function _loader() {
throw new Error(`babel-loader ^8.0.0-beta.3 requires @babel/core@7.0.0-beta.41, but ` + `you appear to be using "${babel.version}". Either update your ` + `@babel/core version, or pin you babel-loader version to 8.0.0-beta.2`);
}
- const config = babel.loadPartialConfig(programmaticOptions);
+ const config = programmaticOptions.configFile ? { options: programmaticOptions } : babel.loadPartialConfig(programmaticOptions);
if (config) {
let options = config.options;
- if (overrides && overrides.config) {
+ if (overrides && overrides.config && !programmaticOptions.configFile) {
options = yield overrides.config.call(this, config, {
source,
customOptions This can work. |
What makes you say that? With the current setup, |
Would you be able to provide an repository with an example of the config not working? I can look into it. |
Maybe I misunderstand the function. |
@loganfsmyth Sorry, I found this error is not made by |
Perfect, thanks. I see just what the problem is now. |
configFile
options
I've posted babel/babel#8315 which should address this once it is merged and published. |
OK! |
| Q | A <!--(Can use an emoji 👍) --> | ------------------------ | --- | Fixed Issues? | Fixes babel/babel-loader#642 | Patch: Bug Fix? | Y | Major: Breaking Change? | N | Minor: New Feature? | | Tests Added + Pass? | Yes | Documentation PR Link | <!-- If only readme change, add `[skip ci]` to your commits --> | Any Dependency Changes? | | License | MIT Since these were getting left in, things that loaded the config, and then passed in back to Babel would get `test` and such _twice_, which could lead to either bad configuration merging, or no configuration at all if the patterns were relative to different directories, as was the case in babel/babel-loader#642.
I'm submitting a bug report
Webpack Version:
3.10.0
Babel Core Version:
7.0.0-beta.53
Babel Loader Version:
8.0.0-beta.3
Please tell us about your environment:
OSX 10.13.5
Current behavior:
I give
configFile
asoptions
like:And this will not get any
plugins
orpresets
withbabel.config.js
.Expected/desired behavior:
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration.
Just need to add
babel.config.js
tooptions.configFile
.What is the expected behavior?
This should work with
babel.config.js
.What is the motivation / use case for changing the behavior?
I use
babel.config.js
in amono repo
. As a result, I want tobabel.config.js
can work, and I only need to write a config file to the root folder.The text was updated successfully, but these errors were encountered: