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
4.1k
1
Share
フロントエンドカンファレンス北海道2024 『小規模サイトでも使えるVite 〜HTMLコーディングをよりスマートに〜』長谷川広武(ハム)
h2ham
August 24, 2024
More Decks by h2ham
See All by h2ham
WordCamp Kansai 2024 ハム『ブロックエディタでWebサイトの制作がどう変わったのか?実装事例から見る現在のWordPressの設計と構築』
h2ham
1
800
WordPress案件を請け負う制作会社からみる Shifter の魅力
h2ham
0
1.5k
WordCamp Osaka 2019 h2ham (´ ºムº `)
h2ham
7
5.1k
WordCamp Tokyo 2017 h2ham toro_unit
h2ham
1
7.5k
デザイナーが効率よくテーマ作成を進めるには? デザインから WordPress のテーマ作成のワークフローを見直す
h2ham
2
6.7k
Other Decks in Programming
See All in Programming
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
420
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
420
AI-DLC Deep Dive
yuukiyo
8
4k
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
130
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
3
340
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
5k
感情を設計する
ichimichi
5
1.5k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
130
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
140
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
500
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
290
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
220
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
Into the Great Unknown - MozCon
thekraken
40
2.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
120
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
490
Deep Space Network (abreviated)
tonyrice
0
110
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
490
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
の インライン化をサポート
以上!
ご清聴ありがとうございました