やり方
天才的な記事があるので 【Vue.js】爆速でSPAを作る 全部これにそってやるだけ
開発環境
- macOS Catalina Version 10.15.4
- Nodejs v14.7.0
- npm 6.14.7
各種インストール
curl -L git.io/nodebrew | perl - setup
nodebrew install latest
nodebrew use latest
node -v
v14.7.0
npm -v
6.14.7
npm install -g vue-cli
プロジェクト作成
vue init webpack single_page_application
? Project name single_page_application
? Project description A Vue.js project
? Author masatonaka <masatonaka1989@gmail.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests Yes
? Pick a test runner jest
? Setup e2e tests with Nightwatch? Yes
? Should we run `npm install` for you after the project has been created? (recommended) n
pm
vue-cli · Generated "single_page_application".
...
# Project initialization finished!
# ========================
To get started:
cd single_page_application
npm run dev
Documentation can be found at https://vuejs-templates.github.io/webpack
できた!!
Run
npm run dev
...
Your application is running here: http://localhost:8080