histoire-dev / histoire

⚡ Fast and beautiful interactive component playgrounds, powered by Vite
https://histoire.dev
MIT License
3.23k stars 192 forks source link

`viteNodeInlineDeps` replaces existing values #762

Open haakonmt opened 2 months ago

haakonmt commented 2 months ago

Describe the bug

If the viteNodeInlineDeps option is set to anything, it completely replaces any value set by other sources, i.e. plugins. Most notably, this completely breaks Nuxt functionality, as all deps set by the Histoire Nuxt plugin are removed.

The reason this happens is due to the change introduced in this commit, but as I don't know the reasoning behind this change, it's difficult to say what else could be impacted by reverting it.

Reproduction

Add the following to the config in the default Nuxt StackBlitz berfore starting the dev server:

viteNodeInlineDeps: [],

System Info

System:
    OS: macOS 14.6.1
    CPU: (14) arm64 Apple M3 Max
    Memory: 99.98 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v20.11.1/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    pnpm: 8.15.4 - ~/Library/pnpm/pnpm
    bun: 1.1.25 - ~/.bun/bin/bun
  Browsers:
    Chrome: 128.0.6613.138
    Safari: 17.6
  npmPackages:
    @histoire/plugin-nuxt: ^0.17.17 => 0.17.17 
    @histoire/plugin-vue: ^0.17.17 => 0.17.17 
    histoire: ^0.17.17 => 0.17.17 
    nuxt: ^3.13.0 => 3.13.0

Used Package Manager

yarn

Validations

haakonmt commented 2 months ago

This might be the root cause of #684