File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -105,17 +105,20 @@ class Config {
105
105
}
106
106
107
107
// 处理loaders => loader
108
- nextConfig . module . loaders . map ( ( loader , i ) => {
109
- if ( loader . loaders && ! loader . loader ) {
110
- loader . loader = loader . loaders . join ( "!" )
111
- }
112
- return loader
113
- } )
108
+ if ( nextConfig . module && nextConfig . module . loaders ) {
109
+ nextConfig . module . loaders . map ( ( loader , i ) => {
110
+ if ( loader . loaders && ! loader . loader ) {
111
+ loader . loader = loader . loaders . join ( "!" )
112
+ }
113
+ return loader
114
+ } )
115
+ }
116
+
114
117
115
118
// 处理alias
116
119
const context = nextConfig . context || this . _config . context
117
120
const relativeContext = sysPath . relative ( this . _config . cwd , context )
118
- if ( nextConfig . resolve . alias ) {
121
+ if ( nextConfig . resolve && nextConfig . resolve . alias ) {
119
122
let alias = nextConfig . resolve . alias
120
123
Object . keys ( alias ) . map ( function ( key , i ) {
121
124
alias [ key ] = sysPath . relative ( relativeContext , alias [ key ] )
You can’t perform that action at this time.
0 commit comments