EvanAgee / vuejs-wordpress-theme-starter

A WordPress theme with the guts ripped out and replaced with Vue.
https://vuewp.com/
1.6k stars 281 forks source link

Deprecated ExtractTextWebpackPlugin blocking upgrades (Tailwind 2, PostCSS) #119

Closed harrisonfm closed 3 years ago

harrisonfm commented 3 years ago

Hi,

I'm trying to upgrade Tailwind to 2.0, but running into issues around its PostCSS dependency. I believe the deprecated plugin ExtractTextWebpackPlugin is the issue. It's been replaced with MiniCssExtractPlugin. I've not yet successfully fixed the build with that newer Webpack plugin. Has anyone done this migration yet?

harrisonfm commented 3 years ago

Fixed with


//package.json 
{
...
"autoprefixer": "^10.0.4",
"postcss-loader": "^4.1.0",
"tailwindcss": "^2.0.1",
"mini-css-extract-plugin": "^1.3.1",
"postcss": "^8.1.10",
}

//webpack/loaders/postcss.js 
{
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
  test: /\.css$/,
    use: [
      MiniCssExtractPlugin.loader,
      'css-loader',
      'postcss-loader',
    ],
};
}

//webpack/plugins/index.js 
{
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
//...
plugins = [
//...
//new ExtractTextPlugin('styles.css')
new MiniCssExtractPlugin({
    filename: 'styles.css'
  }),
]