vue-cliでテンプレートから作成する

テンプレートからnuxtjsを作成する

vueコマンドラインのインストール

$ npm install -g @vue/cli
$ npm install -g @vue/cli-init

vueコマンドラインを利用してスターターテンプレートダウンロード

$ vue init nuxt-community/starter-template nuxtjs
? Project name nuxt
? Project description Nuxt.js project
? Author
$ cd vue-cli
$ yarn
$ npm run dev

http://localhost:3000 にアクセス

テンプレートをインストールした時点でnuxtjs用のディレクトリ構成になっています。

$ ls
README.md   components/ middleware/ nuxt.config.js  pages/      static/     yarn.lock
assets/     layouts/    node_modules/   package.json    plugins/    store/
$ vi pages/index.vue
<template>
   <section class="container">
     おれのnuxtjs
   </section>
</template>

cool