Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Revert broken changes, do not join. #536

Merged
merged 3 commits into from
Dec 5, 2017
Merged

Conversation

timkelty
Copy link
Contributor

@timkelty timkelty commented Dec 5, 2017

@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 via options.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 joining those rules on a pipe for a regex string, which I didn't need to because ImageminWebpackPlugin'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.

Copy link
Member

@eliperelman eliperelman left a 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?

});
return neutrino.config.module.rule(ruleId).get('test');
})
.filter(test => !!test);
Copy link
Member

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. Old habit 🙈

@timkelty
Copy link
Contributor Author

timkelty commented Dec 5, 2017

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?

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.

@timkelty
Copy link
Contributor Author

timkelty commented Dec 5, 2017

Working in my tests

Copy link
Member

@eliperelman eliperelman left a 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.

@eliperelman eliperelman merged commit 8a89d98 into master Dec 5, 2017
timkelty added a commit that referenced this pull request Dec 5, 2017
…rmination, do not join. (#536)

* Revert broken changes, do not join.

* Filter tests

* Filter boolean
@eliperelman eliperelman added the bug label Dec 5, 2017
eliperelman pushed a commit that referenced this pull request Dec 5, 2017
* 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
@edmorley edmorley deleted the fix-imagemin-test branch December 19, 2017 17:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants