Próbowałem skonfigurować Webpack za pomocą LESS i Autoprefixer, ale autoprefixer nie działa. Moje pliki css lub mniej nie są automatycznie naprawione. Przykład: display: flex
pobyty display: flex
Autoprefixer css z pakietem sieci Web
Włożyłem moje WebPACK config poniżej:
var autoprefixer = require('autoprefixer');
module.exports = {
entry: {
bundle: "./index.jsx"
},
output: {
path: __dirname,
filename: "[name].js"
},
module: {
loaders: [
{
test: /\.jsx$/,
exclude: /(node_modules|bower_components)/,
loaders: ['react-hot', 'babel-loader']
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!postcss-loader!less-loader")
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!postcss-loader")
}
],
postcss: function() {
return [autoprefixer];
}
},
plugins: [
new webpack.BannerPlugin(banner),
new ExtractTextPlugin("style.css")
],
devtool: 'source-map',
devServer: {
stats: 'warnings-only',
}
};
czy możesz pokazać przykład? –
@Philll_t, zredagowałem moją odpowiedź dla ciebie :) – wrick17