0
webpack v1からv2に移行しています。私はwebpack.config.js
を更新するために、公式ドキュメントを追っ:Webpack 2にextractTextPluginプラグインとpostCssプラグインを使用
...
module: {
rules: [
{
test: /\.css$/,
use: extractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader?modules&localIdentName=[path][name]_[local]--[hash:base64:8]',
'postcss-loader'
],
}),
exclude: [...]
},
{
test: /\.css$/,
use: extractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader',
}),
include: [...]
}
]
},
...
/**
* postcss: [
* nested(),
* autoprefixer(),
* values
* ]
*/
私の問題は、postcssプラグイン(ネストされた、autoprefixer、値)です。 Webpack 2はカスタムプロパティをこれ以上サポートしておらず、options
の使用を提案しました。
私はoptions
とplugins:() => [nested, autoprefixer, values]
を試しましたが、動作させることはできません。
これを行うには適切な方法はありますか?ありがとう。