-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
[WIP-HELP-WANTED] feat: use arg parsing instead of object-oriented flag setting #1738
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is use case? I can't understand what you try to achive
console.log("Cannot instantiate plugin " + name + ". (" + path + ")"); | ||
throw e; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need it, plugin only for webpack.conifg.js
configuration, trying to load enhanced-resolve
break yarn PnP
let path; | ||
try { | ||
const resolve = require("enhanced-resolve"); | ||
path = resolve.sync(process.cwd(), name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this, because you have require.resolve
const loadUtils = require("loader-utils"); | ||
let args; | ||
try { | ||
const p = name && name.indexOf("?"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plugins can't have ?
in name
ifArg(name, function (bool) { | ||
if (bool === true) options[optionName || name] = true; | ||
else if (bool === false) options[optionName || name] = false; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very misleading, we wee need this - optionName || name
?
finalize && finalize(); | ||
} | ||
|
||
ifArgPair(name, fn, init, finalize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't understand code
What kind of change does this PR introduce?
Uses functions to set flags rather than to check existence
Did you add tests for your changes?
Not yet
If relevant, did you update the documentation?
No
Summary
WIP
Does this PR introduce a breaking change?
No
Other information
Needs help