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
vue-cli 3.0時代のNuxt.js
Search
andoshin11
March 27, 2018
Programming
3
5.8k
vue-cli 3.0時代のNuxt.js
vue-cli 3.0からプロジェクトのカスタマイズがtemplate方式からplugin方式に変わったので、Nuxt starter pluginを作りました
andoshin11
March 27, 2018
Tweet
Share
More Decks by andoshin11
See All by andoshin11
カーナベル株式会社2024年2月 エンジニアイベント資料
andoshin11
0
78
Private Cloudを支える最高のユーザーガイド運用技術
andoshin11
0
250
TS CompilerがVueを喋れても良いじゃないか
andoshin11
0
660
ain't giving up type-safe Express
andoshin11
2
380
Type Safe "Everything"
andoshin11
0
200
Hack your Nuxt router!
andoshin11
0
1.1k
GatewayパターンとSchema駆動開発
andoshin11
8
1.2k
Catch up Nuxt.js 2019.02
andoshin11
0
1.8k
The future of Nuxt.js with TypeScript
andoshin11
0
77
Other Decks in Programming
See All in Programming
Node.js v22 で変わること
yosuke_furukawa
PRO
9
3.2k
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
760
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
使ってみよう Azure AI Document Intelligence
kosmosebi
2
300
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
200
Anthropic Cookbook のおすすめレシピ
schroneko
7
920
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
Netty Chicago Java User Group 2024-04-17
sullis
0
170
Featured
See All Featured
Clear Off the Table
cherdarchuk
84
310k
The Cost Of JavaScript in 2023
addyosmani
16
3.9k
Why Our Code Smells
bkeepers
PRO
331
56k
Teambox: Starting and Learning
jrom
128
8.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
40
4.4k
A Modern Web Designer's Workflow
chriscoyier
689
190k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Design by the Numbers
sachag
274
18k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Ruby is Unlike a Banana
tanoku
96
10k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
The Brand Is Dead. Long Live the Brand.
mthomps
49
28k
Transcript
Nuxt Meetup #1 株式会社 merpay Software Engineer (Frontend) Shin Ando
(@andoshin11) vue-cli 3.0時代のNuxt.js
自己紹介 • Shin Ando (@andoshin11) • Software Engineer (Frontend) •
merpay, Inc (2018/3〜) • Skills • Vue.js • React Native • Rails
信用を創造して、なめらかな社会を創る
Vue conf Amsterdam参加してきました!!
vue-cli 3.0がやってくる!! • Plugin Based Architecture • Zero config by
default • Everything configurable without need for eject still in beta 6...
vue-cli 3.0がやってくる!! $ vue init <template> my-app $ vue create
my-app $ vue add <plugin> // add custom plugin Legacy way... Modern way (^3.0.0)
ところでみなさん... Nuxt、やっていますか?
ところでみなさん... Nuxt、どうやっていますか??
公式によると... https://nuxtjs.org/guide/installation
None
Pluginを作るぞ :muscle: https://github.com/vuejs/vue-cli/blob/dev/docs/plugin-dev.md
Pluginの作成: $ vue add されたときにgeneratorが実行される
Pluginの作成:/generator • /template 以下にプロジェクトにつっこみ たいファイルを用意する
Pluginの作成:/generator/index.js • /template 以下にプロジェクトにつっこみ たいファイルを用意する • index.jsでpackage.jsonを拡張
Pluginの作成:/generator/index.js • /template 以下にプロジェクトにつっこみ たいファイルを用意する • Index.jsでpackage.jsonを拡張 • index.js にtemplateの書き込み処理を記
述
Pluginの作成:/generator/index.js 元々 /src に存在したファイルは /src/legacy 以下に移動する(力技)
出来ました :clap: :clap: https://github.com/andoshin11/vue-cli-plugin-nuxt-starter-template
DEMO
ハマりどころ Babelのpreset指定しないと死ぬ (inside nuxt.config.js)
ハマりどころ Generator APIのhookが少ない。 除外リスト作成 ↓ /src にtemplate書き込み ↓ /src のファイルスキャン(postProcessFiles)
↓ 除外リストになければファイル移動 という4度手間に...
ハマりどころ 既存ファイルとの衝突
まとめ • vue-cli 3.0はいいぞ! • ボイラープレートはvue-cli。そこにNuxtをのっける • Nuxtの立ち位置が変化 「Vuexやvue-routerの設定まとめてやってくれる。ついでにSSRもできる」 ↓
「SSRのためのフレームワーク」
Thanks, and Happy Nuxt Life!! @andoshin11