2017-04-04 7 views
0

Ich versuche, auf Webpack 2 zu aktualisieren, und ich bin in Post-CSS-Ladephase stecken. Hier ist mein entsprechender Code:Webpack löst POSTCSS falsche Konfigurationsfehler

{ 
     test: /\.scss$/, 
     loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!postcss-loader!sass-loader?outputStyle=expanded&sourceComments=true'}), 
     exclude: /\/custom-apps\/|future/ 
    }, 
    { 
     test: /\.scss$/, 
     loader: 'style-loader!css-loader?modules&localIdentName=[local]___[hash:base64:5]&importLoaders=2!postcss-loader!sass-loader?outputStyle=expanded&sourceComments=true', 
     include: /\/custom-apps\/|future/ 
    }, 

Der Fehler erhalte ich:

PostCSS Config could not be loaded. Please check your PostCSS Config.

Antwort

0

eine lokale Datei auf Projektwurzelpfad Hinzufügen

postcss.config.js

mit Inhalt:

module.exports = { 
    importLoaders: 1, 
}; 

habe es für mich getan.

Auch setzen !postcss-loader?importLoaders: 1 in meinem Beispielcode denke ich sollte funktionieren.