File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,30 @@ describe('mergeConfig', () => {
157157
158158 expect ( mergeConfig ( baseConfig , newConfig ) ) . toEqual ( mergedConfig )
159159 } )
160+
161+ test ( 'handles ssr.noExternal' , ( ) => {
162+ const baseConfig = {
163+ ssr : {
164+ noExternal : true
165+ }
166+ }
167+
168+ const newConfig = {
169+ ssr : {
170+ noExternal : [ 'foo' ]
171+ }
172+ }
173+
174+ const mergedConfig = {
175+ ssr : {
176+ noExternal : true
177+ }
178+ }
179+
180+ // merging either ways, `ssr.noExternal: true` should take highest priority
181+ expect ( mergeConfig ( baseConfig , newConfig ) ) . toEqual ( mergedConfig )
182+ expect ( mergeConfig ( newConfig , baseConfig ) ) . toEqual ( mergedConfig )
183+ } )
160184} )
161185
162186describe ( 'resolveConfig' , ( ) => {
Original file line number Diff line number Diff line change @@ -745,7 +745,11 @@ function mergeConfigRecursively(
745745 } else if ( key === 'assetsInclude' && rootPath === '' ) {
746746 merged [ key ] = [ ] . concat ( existing , value )
747747 continue
748- } else if ( key === 'noExternal' && ( existing === true || value === true ) ) {
748+ } else if (
749+ key === 'noExternal' &&
750+ rootPath === 'ssr' &&
751+ ( existing === true || value === true )
752+ ) {
749753 merged [ key ] = true
750754 continue
751755 }
You can’t perform that action at this time.
0 commit comments