@@ -102,17 +102,17 @@ class Config {
102
102
nextConfig . context = sysPath . resolve ( this . _config . cwd , nextConfig . context )
103
103
}
104
104
105
- // if( nextConfig.resolve.alias) {
106
- // let alias = nextConfig.resolve.alias
107
- // Object.keys( alias).map(function(key, i) {
108
- // console.log( alias[key]);
109
- // alias[key] = sysPath.relative(nextConfig.context, alias[key])
110
- // console.log(nextConfig.context , alias[key]);
111
- // })
112
- // extend(true, this._config.resolve.alias, alias);
113
- // }
105
+ const context = nextConfig . context || this . _config . context
106
+ const relativeContext = sysPath . relative ( this . _config . cwd , context )
107
+ if ( nextConfig . resolve . alias ) {
108
+ let alias = nextConfig . resolve . alias
109
+ Object . keys ( alias ) . map ( function ( key , i ) {
110
+ alias [ key ] = sysPath . relative ( relativeContext , alias [ key ] )
111
+ } )
112
+ extend ( true , this . _config . resolve . alias , alias ) ;
113
+ }
114
114
115
- this . _config . resolve . root . push ( nextConfig . context )
115
+ this . _config . resolve . root . push ( context )
116
116
117
117
extend ( true , this . _config , nextConfig ) ;
118
118
}
0 commit comments