nuxt / nuxt/image

Array/object default options (format, screen, domains, densities…) cannot be overrided

Open
#1,874 1 comment 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.5k
Forks
331
Avg merge
19h 52m
Merged PRs (30d)
9

Description

Due to the use of DefineNuxtModule({ defaults: ... }), any user-provided configuration in nuxt.config.js is merged with the module defaults, including all array and object options.

For exampke, this behavior prevent the user to override default densities: [ 1, 2 ] with densities: [ 1 ]. This is a major issue to me.

A solution could be to use defuFn or a custom merger to allow overriding some properties with functions while preserving the default behavior.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the module configuration entry point using DefineNuxtModule({ defaults: ... }) and review how nuxt.config.js values are merged. Reproduce the densities example with [1, 2] and [1], then verify that array and object options can be explicitly overridden while other defaults remain intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.