I'm getting quite frustrated trying to get autoprefixer working.
Here is my webpack.config.js
const HtmlWebPackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const config = {
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.(scss)$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: "css-loader", options: {} },
{ loader: "postcss-loader", options: {} },
// {
// loader: "postcss-loader",
// options: {
// ident: "postcss",
// plugins: (loader) => [
// require('autoprefixer')({ browsers: ['defaults']})
// ]
// }
// },
{ loader: "sass-loader", options: {} }
]
},
{
test: /\.mp3$/,
use: {
loader: "file-loader"
}
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html"
}),
new MiniCssExtractPlugin({
filename: "main.css"
})
]
};
module.exports = config;
Here is my postcss.config.js
module.exports = {
plugins: [
require('autoprefixer')()
]
}
Currently my package.json is holding my browserslist options
As you can see I've tried using the webpack file to hold my config settings for postcss-loader and I've also tried creating a separate config file.
I've tried moving the browserslist but I don't think that's the issue bc I run npx browserslist
and I can see a list of browsers that were selected.
My postcss-loader
declaration in my webpack config comes after css-loader
and before sass-loader
I also receive no errors in my console when I run webpack so not sure what is happening but could really use some help!