Использую следующий postcss.config.js:const postcssImport = require("postcss-import");
const cssnext = require("cssnext");
const autoprefixer = require("autoprefixer");
const cssnano = require("cssnano");
module.exports = function() {
return {
plugins: [
postcssImport,
cssnext,
autoprefixer({
browsers: ["last 2 versions"]
}),
cssnano
]
};
};
webpack.config.js:module.exports = {
entry: PATHS.app + "/js/application.js",
output: {
path: PATHS.build,
filename: "js/[name].js"
},
module: {
rules: [
{
test: /\.pug$/,
loader: "pug-loader",
options: {
pretty: true
}
},
{
test: /\.css$/,
use: [
"style-loader",
{
loader: "css-loader",
options: { importLoaders: 1 }
},
{
loader: "postcss-loader",
options: { sourceMap: true }
}
]
}
]
},
devtool: env === "development" ? "eval-source-map" : "",
plugins: [
new HtmlWebpackPlugin({
filename: "index.html",
template: PATHS.app + "/templates/layouts/layout.pug"
})
....
]
....
};
В результате получаю сломанную сборку