-
Notifications
You must be signed in to change notification settings - Fork 213
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.
Just a small nit.
I changed this during one of my refactors, I think for create-project tests, because I couldn't get some tests to pass. Maybe this is gone now though and we can move forward. Have you tested that this functions properly?
packages/imagemin/index.js
Outdated
}); | ||
return neutrino.config.module.rule(ruleId).get('test'); | ||
}) | ||
.filter(test => !!test); |
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.
This can be .filter(Boolean)
.
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.
Of course. Old habit 🙈
Yeah - actually I was testing other stuff w/ create-project and thats how I discovered it wasn't working. I will do some more testing to be certain. |
Working in my tests |
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.
Great, thanks for your diligence here @timkelty, appreciate it. Sorry for putting you through this hassle.
…rmination, do not join. (#536) * Revert broken changes, do not join. * Filter tests * Filter boolean
* Move imagemin to image-minify Move minify to babel-minify Make minify an aggregate * Readme fixes, plugin const * Allow excluding presets by passing false in `minify` * WS * Never pass true, {} instead * Coerce true from web. * Fix short circuit * Removing log. * Sync docs/ and packages/ and other docs fixes (#528) * Docs: Sync the READMEs in docs/ and packages/ * Docs: Remove duplicate "zero upfront configuration" reference Since it appears in both the "extends from" and the main features list. * Docs: Sync the web features list with presets that extend from it * Docs: Fix description for react-components * Update outstanding changes to docs and add more detailed comments (#531) * Migrate clean options from v7 branch to master to allow all options for clean middleware (#530) * Remove json from being in options.extensions, update docs on extensions accordingly (#533) * Revert broken changes in image minification middleware's testing determination, do not join. (#536) * Revert broken changes, do not join. * Filter tests * Filter boolean * Udate CHANGELOG.md (#535) * Merge test babel config in root config to deal with JSX pragma plugin precedence (#537) * Move imagemin to image-minify Move minify to babel-minify Make minify an aggregate * Allow excluding presets by passing false in `minify` * Coerce true from web. * Improve help/incorrect usage output of CLI (#514) * Add option to get package.json content (#534) * Add packageJson option to get package.json * Wrap require statement with try catch and rename packageJson * Revert pkgJson to packageJson * Nits * Remove extra blank line * Destructure out join * Use null instead of undefined for options.packageJson * Use extensions in outstanding package (#532) * Update tests * Fix doc paths. * Merge options, minify by default when calling directly. * No style-minify yet
@eliperelman changes introduced here broke things a bit: 9380f02#diff-3813a5588840cf846f7dfcf2cc0bc30b
This MW basically assumes you're using
image-loader
, or something else that would define image rules. Those pre-existing rule ids are what is configurable viaoptions.rules
.For that reason, I was intentionally omitting the
.test
, as we can assume it already exists in that rule.I'm then mapping the value of the actual test, so I can pass it all to the plugin's
test
option.Your changes were using
options.rules
as extensions, and calling.test
, which ended up passing something like/(\.svg|\.img)$/
Note:
I was
join
ing those rules on a pipe for a regex string, which I didn't need to becauseImageminWebpackPlugin
's test option can be an array.TL;DR
This PR reverts those changes with the exception of the unnecessary
join('|')
. If you have other ideas or preferences how to do this, I'm happy to make changes.