Autoprefix css in development

This commit is contained in:
Ken-Håvard Lieng 2018-05-25 03:27:53 +02:00
parent b4c9338772
commit e2a895a1b9
1 changed files with 24 additions and 1 deletions

View File

@ -1,5 +1,6 @@
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
module.exports = {
mode: 'development',
@ -28,7 +29,29 @@ module.exports = {
}
},
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.css$/, loader: 'style-loader!css-loader' }
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: false
}
},
{
loader: 'postcss-loader',
options: {
plugins: [
require('postcss-flexbugs-fixes'),
autoprefixer({
flexbox: 'no-2009'
})
]
}
}
]
}
]
},
plugins: [new webpack.HotModuleReplacementPlugin()]