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?

bolt.newでエクスポートしたnextjsプロジェクトにcssが反映されない時の対処法

Last updated at Posted at 2025-05-20

概要

今更bolt.newを触った時に予期せぬエラーが発生したので、同じミスをした同志のために対処法を残しておきます。

結論

bolt.newからインポートした tailwind.config.ts ファイルの content/src を追加してください。

content: [
-    './pages/**/*.{js,ts,jsx,tsx,mdx}',
-    './components/**/*.{js,ts,jsx,tsx,mdx}',
-    './app/**/*.{js,ts,jsx,tsx,mdx}',
+    './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
+    './src/components/**/*.{js,ts,jsx,tsx,mdx}',
+    './src/app/**/*.{js,ts,jsx,tsx,mdx}',
],

経緯

  • bolt.newの作成するプロジェクトのコンポーネントは src/ ディレクトリに配置されない
  • npx create-next-app@latestnextjs プロジェクトを作成したとき コンポーネントは src/ ディレクトリに配置される

上記の違いにより、 tailwind.config.ts をそのままインポートしたら、tailwindの参照が切れました。

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?