I have successfully set up TailwindCSS on Gridsome by following these instructions: https://gridsome.org/docs/assets-css/#tailwind
However, those instructions do not mention how to also set up autoprefixer. So, I gave it a try on my own -- as follows:
- npm install autoprefixer
- Modified the
gridsome.config.js
file (see below for modified code with comments of what I changed) - Ran
gridsome develop
- Added the class of
flex
to ap
to see whether or not there are any vendor prefixes added.
The result...
Nothing. No prefixes (just display: flex;
).
Any idea how to get this to work?
Thanks
Modified gridsome.config.js file:
const autoprefixer = require("autoprefixer"); // ADDED THIS LINE
const tailwind = require("tailwindcss");
const purgecss = require("@fullhuman/postcss-purgecss");
const postcssPlugins = [tailwind(), autoprefixer()]; // ADDED `autoprefixer()` to postcssPlugins array
if (process.env.NODE_ENV === "production") postcssPlugins.push(purgecss());
module.exports = {
siteName: "Gridsome",
plugins: [],
css: {
loaderOptions: {
postcss: {
plugins: postcssPlugins
}
}
}
};