11import path from 'path' ;
22import from from 'resolve-from' ;
3- import { merge , omit , values } from 'lodash' ;
3+ import { merge , omit } from 'lodash' ;
44
55// Resolve extend configs
66export default function resolveExtends ( config = { } , context = { } ) {
@@ -18,8 +18,7 @@ export default function resolveExtends(config = {}, context = {}) {
1818
1919// (any, string, string, Function) => any[];
2020function loadExtends ( config = { } , context = { } ) {
21- const toExtend = values ( config . extends || [ ] ) ;
22- return toExtend . reduce ( ( configs , raw ) => {
21+ return ( config . extends || [ ] ) . reduce ( ( configs , raw ) => {
2322 const id = getId ( raw , context . prefix ) ;
2423 const resolve = context . resolve || resolveId ;
2524 const resolved = resolve ( id , context ) ;
@@ -46,7 +45,6 @@ function getId(raw = '', prefix = '') {
4645 return ( scoped || relative ) ? raw : [ prefix , raw ] . filter ( String ) . join ( '-' ) ;
4746}
4847
49- function resolveId ( id , context ) {
50- const cwd = context . cwd || process . cwd ( ) ;
51- return from ( cwd , id ) ;
48+ function resolveId ( id , context = { } ) {
49+ return from ( context . cwd || process . cwd ( ) , id ) ;
5250}
0 commit comments