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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
h2ham
August 24, 2024
Programming
4.2k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
フロントエンドカンファレンス北海道2024 『小規模サイトでも使えるVite 〜HTMLコーディングをよりスマートに〜』長谷川広武(ハム)
h2ham
August 24, 2024
More Decks by h2ham
See All by h2ham
WordCamp Kansai 2024 ハム『ブロックエディタでWebサイトの制作がどう変わったのか?実装事例から見る現在のWordPressの設計と構築』
h2ham
1
820
WordPress案件を請け負う制作会社からみる Shifter の魅力
h2ham
0
1.5k
WordCamp Osaka 2019 h2ham (´ ºムº `)
h2ham
7
5.2k
WordCamp Tokyo 2017 h2ham toro_unit
h2ham
1
7.5k
デザイナーが効率よくテーマ作成を進めるには? デザインから WordPress のテーマ作成のワークフローを見直す
h2ham
2
6.7k
Other Decks in Programming
See All in Programming
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
160
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
A2UI という光を覗いてみる
satohjohn
1
140
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
190
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
260
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
720
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
13k
ふつうのFeature Flag実践入門
irof
8
4.1k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.8k
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Designing Powerful Visuals for Engaging Learning
tmiket
1
420
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
Evolving SEO for Evolving Search Engines
ryanjones
0
220
Practical Orchestrator
shlominoach
191
11k
The Curse of the Amulet
leimatthew05
1
13k
Marketing to machines
jonoalderson
1
5.5k
Ruling the World: When Life Gets Gamed
codingconduct
0
260
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
A better future with KSS
kneath
240
18k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
KATA
mclloyd
PRO
35
15k
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
の インライン化をサポート
以上!
ご清聴ありがとうございました