0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Tailwind v4 で読み込むソースを減らす方法

0
Last updated at Posted at 2025-05-20

概要

Tailwind v4では自動でソースが読み込まれるが、対象外にするほうがわかりにくいので共有です。

tailwind.css
@source not '../**/*.{js,jsx,ts,tsx,liquid}';
@import 'tailwindcss';

だめなもの

以下は無意味です。 @config で指定しても対象外になりません。

tailwind.config.js
module.exports = {
  content: [],
};

べつのもの

以下でもいけます。

tailwind.css
@config '../tailwind.config.js';
@import 'tailwindcss';
tailwind.config.js
module.exports = {
  content: ['!./**/*.{js,jsx,ts,tsx}'],
};
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?