Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
vue-cli 3.0時代のNuxt.js
andoshin11
March 27, 2018
Programming
3
5.5k
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
Private Cloudを支える最高のユーザーガイド運用技術
andoshin11
0
200
TS CompilerがVueを喋れても良いじゃないか
andoshin11
0
560
ain't giving up type-safe Express
andoshin11
2
340
Type Safe "Everything"
andoshin11
0
170
Hack your Nuxt router!
andoshin11
0
950
GatewayパターンとSchema駆動開発
andoshin11
8
1.2k
Catch up Nuxt.js 2019.02
andoshin11
0
1.5k
The future of Nuxt.js with TypeScript
andoshin11
0
64
Clean Architecture with Vue
andoshin11
13
8k
Other Decks in Programming
See All in Programming
AWSとCPUのムフフな関係
cmdemura
0
470
An Advanced Introduction to R
nicetak
0
1.8k
Showkase、Paparazziを用いたビジュアルリグレッションテストの導入にチャレンジした話 / MoT TechTalk #15
mot_techtalk
0
110
Hatena Engineer Seminar #23「新卒研修で気軽に『ありがとう』を伝え合える Slack アプリを開発した話」
slashnephy
0
310
Makuakeの認証基盤とRe-Architectureチーム
bmf_san
0
590
ECテックカンファレンス2023
kspace
1
350
(新米)エンジニアリングマネージャーのしごと #RSGT2023
murabayashi
9
5.8k
Jetpack Compose 完全に理解した
mkeeda
1
470
社会人 20 年目エンジニア、発信で技術学びなおしてる話
e99h2121
1
140
Amebaブログの会員画面システム刷新の道程
ryotasugawara
1
240
domain層のモジュール化 / MoT TechTalk #15
mot_techtalk
0
110
2023年にクル(かもしれない)通信ミドルウェア技術(仮)
s_hosoai
0
210
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
108
5.9k
Support Driven Design
roundedbygravity
88
8.9k
What’s in a name? Adding method to the madness
productmarketing
12
1.9k
Infographics Made Easy
chrislema
235
17k
How to Ace a Technical Interview
jacobian
270
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
13
1.1k
The Invisible Side of Design
smashingmag
292
48k
Producing Creativity
orderedlist
PRO
335
38k
GraphQLの誤解/rethinking-graphql
sonatard
39
7.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
2
400
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
31
20k
Build your cross-platform service in a week with App Engine
jlugia
221
17k
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