Skip to content

Conversation

@alexander-akait
Copy link
Member

@alexander-akait alexander-akait commented Jun 6, 2023

Part of webpack/webpack-cli#3836

Allow to use:

// `false` value for an example, for example when you are in development mode and don't want to use plugin
// so you don't need to use `.filter(Boolean)`, it is faster and has a better DX
const isProduction = false; 

module.exports = {
  //...
  resolve: {
    plugins: [
      isProduction && new DirectoryNamedWebpackPlugin()
    ],
  },
};

Note - you an use any falsy values, NaN is falsy too, but microsoft/TypeScript#15135, and I don't think it is a good idea allow to pass NaN

@alexander-akait alexander-akait marked this pull request as ready for review June 6, 2023 20:49
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@3c3d31e). Click here to learn what that means.
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head f5677bc differs from pull request most recent head 3a765d9. Consider uploading reports for the commit 3a765d9 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #389   +/-   ##
=======================================
  Coverage        ?   92.85%           
=======================================
  Files           ?       43           
  Lines           ?     2042           
  Branches        ?      598           
=======================================
  Hits            ?     1896           
  Misses          ?      118           
  Partials        ?       28           
Impacted Files Coverage Δ
lib/ResolverFactory.js 96.15% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TheLarkInn TheLarkInn merged commit d08a64d into main Jun 13, 2023
@TheLarkInn TheLarkInn deleted the feat-accept-nullish-plugins branch June 13, 2023 14:49
renovate bot referenced this pull request in Unleash/unleash Jun 22, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [enhanced-resolve](https://togithub.com/webpack/enhanced-resolve) |
[`5.14.1` ->
`5.15.0`](https://renovatebot.com/diffs/npm/enhanced-resolve/5.14.1/5.15.0)
|
[![age](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.15.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.15.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.15.0/compatibility-slim/5.14.1)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.15.0/confidence-slim/5.14.1)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>webpack/enhanced-resolve</summary>

###
[`v5.15.0`](https://togithub.com/webpack/enhanced-resolve/releases/tag/v5.15.0)

[Compare
Source](https://togithub.com/webpack/enhanced-resolve/compare/v5.14.1...v5.15.0)

#### New Features

- Ignore `false`/`null`/`undefined` plugins by
[@&#8203;alexander-akait](https://togithub.com/alexander-akait) in
[https://github.com/webpack/enhanced-resolve/pull/389](https://togithub.com/webpack/enhanced-resolve/pull/389)

#### Dependencies & Maintenance

- GitHub Workflows security hardening by
[@&#8203;sashashura](https://togithub.com/sashashura) in
[https://github.com/webpack/enhanced-resolve/pull/370](https://togithub.com/webpack/enhanced-resolve/pull/370)
- Add cSpell commit hook by
[@&#8203;nschonni](https://togithub.com/nschonni) in
[https://github.com/webpack/enhanced-resolve/pull/327](https://togithub.com/webpack/enhanced-resolve/pull/327)

#### New Contributors

- [@&#8203;sashashura](https://togithub.com/sashashura) made their first
contribution in
[https://github.com/webpack/enhanced-resolve/pull/370](https://togithub.com/webpack/enhanced-resolve/pull/370)

**Full Changelog**:
webpack/enhanced-resolve@v5.14.1...v5.15.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Shipped

Development

Successfully merging this pull request may close these issues.

4 participants