Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
harrisonfm opened this issue Nov 27, 2020 · 1 comment

Comments

@harrisonfm
Copy link

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
Copy link
Author

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'
  }),
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant