-
Notifications
You must be signed in to change notification settings - Fork 94
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
Change match() to pass all webpack rule options to context. #250
Changes from 1 commit
d345ba5
bcc39fe
be05cf4
416391e
d17af58
6a885c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# @webpack-blocks/core - Changelog | ||
|
||
## master | ||
|
||
- Change `match()` to passes all [webpack rule options](https://webpack.js.org/configuration/module/) to context. ([#250](https://github.com/andywer/webpack-blocks/pull/250)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. passes -> pass |
||
|
||
## 1.0.0-beta.2 | ||
|
||
- More useful error message when passing invalid blocks to `createConfig()` ([#171](https://github.com/andywer/webpack-blocks/issues/171)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ module.exports = match | |
* | ||
* @param {string|RegExp|Function|Array} test A glob like `*.css` or `{*.js, *.jsx}` or something else to use as `loader.test`. | ||
* @param {object} [options] Optional advanced matching options. | ||
* @param {string|Function|RegExp|Array|object} [options.include] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we remove those hints, then we definitely need to improve the documentation of the overall |
||
* @param {string|Function|RegExp|Array|object} [options.exclude] | ||
* @param {Function[]} configSetters Array of functions as returned by webpack blocks. | ||
* @return {Function} | ||
*/ | ||
|
@@ -23,20 +21,13 @@ function match (test, options, configSetters) { | |
|
||
assertConfigSetters(configSetters) | ||
|
||
const match = { test: createFileTypeMatcher(test) } | ||
options.test = createFileTypeMatcher(test) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should print a warning if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, if |
||
|
||
if (options.exclude) { | ||
match.exclude = options.exclude | ||
} | ||
if (options.include) { | ||
match.include = options.include | ||
} | ||
|
||
const groupBlock = context => config => invokeConfigSetters(configSetters, deriveContextWithMatch(context, match), config) | ||
const groupBlock = context => config => invokeConfigSetters(configSetters, deriveContextWithMatch(context, options), config) | ||
|
||
return Object.assign(groupBlock, { | ||
pre: context => invokePreHooks(configSetters, deriveContextWithMatch(context, match)), | ||
post: context => config => invokePostHooks(configSetters, deriveContextWithMatch(context, match), config) | ||
pre: context => invokePreHooks(configSetters, deriveContextWithMatch(context, options)), | ||
post: context => config => invokePostHooks(configSetters, deriveContextWithMatch(context, options), config) | ||
}) | ||
} | ||
|
||
|
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.
master -> Next version (like we used before)