Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
フロントエンドカンファレンス北海道2024 『小規模サイトでも使えるVite 〜HTMLコーデ...
Search
h2ham
August 24, 2024
Programming
1
3.8k
フロントエンドカンファレンス北海道2024 『小規模サイトでも使えるVite 〜HTMLコーディングをよりスマートに〜』長谷川広武(ハム)
h2ham
August 24, 2024
Tweet
Share
More Decks by h2ham
See All by h2ham
WordCamp Kansai 2024 ハム『ブロックエディタでWebサイトの制作がどう変わったのか?実装事例から見る現在のWordPressの設計と構築』
h2ham
1
750
WordPress案件を請け負う制作会社からみる Shifter の魅力
h2ham
0
1.3k
WordCamp Osaka 2019 h2ham (´ ºムº `)
h2ham
7
4.9k
WordCamp Tokyo 2017 h2ham toro_unit
h2ham
1
7.3k
デザイナーが効率よくテーマ作成を進めるには? デザインから WordPress のテーマ作成のワークフローを見直す
h2ham
2
6.6k
Other Decks in Programming
See All in Programming
rage against annotate_predecessor
junk0612
0
170
Laravel Boost 超入門
fire_arlo
3
210
旅行プランAIエージェント開発の裏側
ippo012
2
890
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
420
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.2k
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
140
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.4k
Swift Updates - Learn Languages 2025
koher
2
470
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
270
時間軸から考えるTerraformを使う理由と留意点
fufuhu
15
4.7k
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
430
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Building an army of robots
kneath
306
46k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.9k
Practical Orchestrator
shlominoach
190
11k
Unsuck your backbone
ammeep
671
58k
Building Adaptive Systems
keathley
43
2.7k
Git: the NoSQL Database
bkeepers
PRO
431
66k
What's in a price? How to price your products and services
michaelherold
246
12k
Transcript
⼩規模サイトでも使えるVite 〜HTMLコーディングをよりスマートに〜 ⻑⾕川 広武 株式会社HAMWORKS
⾃⼰紹介
ハム ⻑⾕川 広武 は せ が わ ひろむ 株式会社HAMWORKS bit
part 合同会社 株式会社カワラバン SaCSS 主催
None
本題
https://ja.vitejs.dev/
https://ja.vitejs.dev/ ⾼速なビルドツール 軽量かつ直感的な開発環境 ⼩規模サイトでも導⼊が容易で、設定がシンプル Vite
None
None
None
src _layouts css js main.js assets index.html default.html header.html footer.html
style.css modules modules
dist css js main.js assets index.html style.css
src css js main.js assets index.html style.css 静的なページのビルド Static Site
Generation
src _layouts css js main.js assets index.html default.html header.html footer.html
style.css component modules
src _layouts css js main.js assets index.html default.html header.html footer.html
style.css component modules 納品後にCMSテンプレート化案件
余談
None
https://wordpress.org/news/2018/12/bebo/ 2018年12⽉6⽇
None
None
WordPress案件では 静的HTML制作は、もう⾏わない
src _layouts css js main.js assets index.html default.html header.html footer.html
style.css component modules WordPress 以外の 納品後にCMSテンプレート化案件
None
以前はローカルサーバー動かして PHPのインクルードで対応 なんて時代もあった
https://astro.build/
https://astro.build/ 最近では Astro の利⽤も
https://astro.build/
https://www.11ty.dev/
https://www.11ty.dev/ 11ty のほうが構成的にも HTML だけを⾒るならシンプルに
https://www.11ty.dev/
https://pugjs.org/api/getting-started.html
https://pugjs.org/api/getting-started.html
https://pugjs.org/api/getting-started.html
https://pugjs.org/api/getting-started.html CMSテンプレートにする場合 Pug は避けたい (そのまま使い難い)
https://ejs.co/
https://ejs.co/
https://ejs.co/ EJSもシンプルだが layout ベースでの構成だと ひと⼿間かかってしまう
https://mozilla.github.io/nunjucks/
https://mozilla.github.io/nunjucks/ 11ty で Nunjucks エンジン利⽤が 構成的にシンプル
https://docs.github.com/ja/pages
https://docs.github.com/ja/pages Nunjucks エンジンにしているのは GitHub Pages で使われていた jekyll がシンプルで好んでいる為
https://jekyllrb.com/
https://shopify.github.io/liquid/
https://jinja.palletsprojects.com/en/3.1.x/
None
None
None
None
シンプルな設定だけだと CSS・JSのビルド後のファイル名が ⾃動で変換かかってしまう
None
None
None
dist css js main.js assets index.html style.css
dist css js main.js assets index.html style.css ディレクトリ・ファイル名を 任意のものにするための コードを追加で、⾃由にできる
./src/assets/css/style.css
./src/assets/css/style.css Vite は、postcss-import を介した CSS @import のインライン化を デフォルトでサポート
まとめ
静的HTMLの案件でも Vite の利⽤が便利 CMS化案件時はシンプルに渡せるものを利⽤ Viteはデフォルトで CSS @import
の インライン化をサポート
以上!
ご清聴ありがとうございました