Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Easily override an array like this: const config = mergeConfig(
configA,
configB,
);
// override some array *after* merging.
config.test.includes = ['foo/*.js', 'bar/*.js']
export default config |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Project Structure
Description
I'm trying to extend the root Vite config in my theme package while overriding the
build.lib.entry
option. However, I'm encountering unexpected behavior when usingmergeConfig
.Root Vite Config (vite.config.mts)
Theme Package Vite Config (packages/theme/vite.config.mts)
When using mergeConfig:
This results in an error:
However, using spread operator works fine:
Questions
Is my usage of mergeConfig incorrect? If so, what's the proper way to use it in this case?
If using the spread operator works, is it safe to use it instead of mergeConfig? Are there any potential issues I should be aware of?
Environment
Vite version: [6.0.2]
Node.js version: [20.16]
OS: macOS
Beta Was this translation helpful? Give feedback.
All reactions