00.rubyonrails:23.rails7でtailwindcss
差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
00.rubyonrails:23.rails7でtailwindcss [2022/09/03] – 作成 adash333 | 00.rubyonrails:23.rails7でtailwindcss [2022/09/06] (現在) – [見出し] adash333 | ||
---|---|---|---|
行 4: | 行 4: | ||
===== 見出し ===== | ===== 見出し ===== | ||
+ | |||
+ | rails newのときに、 | ||
+ | < | ||
+ | rails new myapp -c tailwind | ||
+ | </ | ||
+ | これをすると、Javascriptまわりは、importmap-rails が導入される。 | ||
+ | 自動的にjsbundling-rails(+esbuild or webpack)を使用することになる(importmap-railsは使用しない)。そのため、開発環境でサーバを起動するときは、rails sではなく、 | ||
+ | |||
+ | bin/dev | ||
+ | となる。(importmap-rails の場合は、rails sでサーバ起動。) | ||
+ | |||
https:// | https:// | ||
行 13: | 行 24: | ||
Gemfileに | Gemfileに | ||
- | Gemfile | + | < |
gem ' | gem ' | ||
+ | </ | ||
を追記して、下記2行を実行。 | を追記して、下記2行を実行。 | ||
+ | < | ||
+ | bundle install | ||
+ | bundle exec rails tailwindcss: | ||
+ | </ | ||
+ | |||
+ | |||
- | $ bundle install | ||
- | $ bundle exec rails tailwindcss: | ||
+ | https:// | ||
+ | @345dvl | ||
+ | 更新日 2022年04月05日 | ||
+ | Rails 7でTailwind CSSを使ってみた | ||
+ | →docker-compose.ymlでRailsアプリのコンテナにtty: | ||
00.rubyonrails/23.rails7でtailwindcss.1662197522.txt.gz · 最終更新: 2022/09/03 by adash333