JSPM

@tailwindcss/webpack

0.0.0-insiders.bfb5732
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 57766
  • Score
    100M100P100Q143546F
  • License MIT

A webpack loader for Tailwind CSS v4.

Package Exports

  • @tailwindcss/webpack

Readme

Tailwind CSS

A utility-first CSS framework for rapidly building custom user interfaces.

Build Status Total Downloads Latest Release License


Documentation

For full documentation, visit tailwindcss.com.

Community

For help, discussion about best practices, or feature ideas:

Discuss Tailwind CSS on GitHub

Contributing

If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.


@tailwindcss/webpack

A webpack loader for Tailwind CSS v4.

Installation

npm install @tailwindcss/webpack

Usage

// webpack.config.js
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

module.exports = {
  plugins: [new MiniCssExtractPlugin()],
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [MiniCssExtractPlugin.loader, 'css-loader', '@tailwindcss/webpack'],
      },
    ],
  },
}

Then create a CSS file that imports Tailwind:

/* src/index.css */
@import 'tailwindcss';

Options

base

The base directory to scan for class candidates. Defaults to the current working directory.

{
  loader: '@tailwindcss/webpack',
  options: {
    base: process.cwd(),
  },
}

optimize

Whether to optimize and minify the output CSS. Defaults to true in production mode.

{
  loader: '@tailwindcss/webpack',
  options: {
    optimize: true, // or { minify: true }
  },
}