fix(tailwind): Ensure tailwind properly purges unused utility classes (#2485)

This commit is contained in:
Erik Ziegler authored and GitHub committed 2021-07-26 13:22:25 +02:00
1 parent 44e935f209
commit 3220af737c
33 files changed
+1028 -243

No files matched your search

+14 -2
View File
@@ -1,14 +1,26 @@
const autoprefixer = require('autoprefixer');
const path = require('path');
const tailwindcss = require('tailwindcss');
const tailwindConfigPath = path.resolve('tailwind.config.js');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const devMode = process.env.NODE_ENV !== 'production';
const cssToJavaScript = {
test: /\.css$/,
use: [
'style-loader',
//'style-loader',
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { importLoaders: 1 } },
{
loader: 'postcss-loader',
options: {
plugins: () => [autoprefixer('last 2 version', 'ie >= 11')],
postcssOptions: {
verbose: true,
plugins: [
[tailwindcss(tailwindConfigPath)],
[autoprefixer('last 2 version', 'ie >= 11')],
],
},
},
},
],