Nuxt.js + Netlify、Nuxt.js + Firebase Hostingでリリース
Netlify
➜ nuxt-sample git:(master) netlify init ? What would you like to do? + Create & configure a new site Choose a site name or leave blank for a random name. You can update later. ? Site name (optional): tiwu-nuxt-sample ? Account: tiwu official's team (personal) Site Created ? Your build command (hugo build/yarn run build/etc): npm run generate ? Directory to deploy (blank for current dir): dist ? No netlify.toml detected. Would you like to create one with these build settings? Yes
netlify init
叩いて、新しいNetlifyのSiteを作って、npm run generate
とdist
を指定して終了。
楽ちんすぎた。
PWAをオンにしてたから、Auditsも満点。
Firebase Hosting
nuxt-sample git:(master) firebase init ######## #### ######## ######## ######## ### ###### ######## ## ## ## ## ## ## ## ## ## ## ## ###### ## ######## ###### ######## ######### ###### ###### ## ## ## ## ## ## ## ## ## ## ## ## #### ## ## ######## ######## ## ## ###### ######## You're about to initialize a Firebase project in this directory: /nuxt-sample ? Which Firebase CLI features do you want to setup for this folder? Press Space to select features, then Enter to confirm your choices. Hosting: Configure and deploy Firebase Hosting sites === Project Setup First, let's associate this project directory with a Firebase project. You can create multiple project aliases by running firebase use --add, but for now we'll just set up a default project. ? Select a default Firebase project for this directory: [create a new project] === Hosting Setup Your public directory is the folder (relative to your project directory) that will contain Hosting assets to be uploaded with firebase deploy. If you have a build process for your assets, use your build's output directory. ? What do you want to use as your public directory? dist ? Configure as a single-page app (rewrite all urls to /index.html)? Yes ✔ Wrote dist/index.html i Writing configuration info to firebase.json... i Writing project information to .firebaserc... ✔ Firebase initialization complete! Project creation is only available from the Firebase Console Please visit https://console.firebase.google.com to create a new project, then run firebase use --add
What do you want to use as your public directory?
はdist
を
Configure as a single-page app (rewrite all urls to /index.html)?
はYes
を
毎回コマンド叩くときにPJ作っておくの忘れる。
netlifyはinit時に作ってくれるんだけどな・・・。
yarn generate firebase deploy
ビルドもnetlifyと比べると面倒くさい。
tiwu-nuxt-sample.firebaseapp.com
余談
とりあえず何か新しいの覚えたときにリリースまでできないと不安でしょうがない・・・。