antfu-collective / unconfig

A universal solution for loading configurations.
MIT License
594 stars 19 forks source link

When my config content is array, I get a {} #26

Closed Muluk-m closed 5 months ago

Muluk-m commented 5 months ago

Describe the bug

It seems that the reason is that array is not supported when using defu for config merge

image

Reproduction

  1. build.config returns an array.
  2. In terminal, execute npm run dev

System Info

System:
    OS: macOS 13.3.1
    CPU: (8) x64 Apple M1 Pro
    Memory: 21.34 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.20.0 - ~/.nvm/versions/node/v16.20.0/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.0/bin/npm
    pnpm: 8.15.4 - ~/.nvm/versions/node/v16.20.0/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.87
    Safari: 16.4

Used Package Manager

pnpm

Validations

antfu commented 5 months ago

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required

Muluk-m commented 5 months ago

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required

https://stackblitz.com/edit/stackblitz-starters-a8aypj?file=package.json Sorry, now I made a demo to illustrate my problem

antfu commented 5 months ago

Fixed 84bea2a57d52fa72e4da3a4b7d969106dc36b1c2