【React】Windows10にReact+Laravelの開発環境を構築してみた
はじめに
Chocolatey、VirtualBox、Vagrantがインストールされている事。
Homestead Vagrant Boxのインストール
$ vagrant box add laravel/homesteadHomesteadのインストール
$ git clone https://github.com/laravel/homestead.git Homestead
$ cd Homestead
$ git checkout release
Switched to a new branch 'release'
Branch 'release' set up to track remote branch 'release' from 'origin'.
$ init.bat
1 個のファイルをコピーしました。
1 個のファイルをコピーしました。
1 個のファイルをコピーしました。
Homestead initialized!Homesteadの設定
Homestead.yamlの設定を変更します。
今回は共有フォルダの設定とNginxの設定を変更します。
folders:
- map: C:\code\my_app
to: /home/vagrant/code/my_app
sites:
- map: homestead.test
to: /home/vagrant/code/my_app/public鍵の作成
$ ssh-keygen -b 4096Vagrantの実行
$ vagrant upVagrantにssh接続
$ vagrant sshプロジェクト作成
$ cd code/
$ composer create-project --prefer-dist laravel/laravel my_appReactのインストール
$ cd my_app
$ composer require laravel/ui
$ php artisan ui react --auth
$ npm install && npm run dev起動
$ php artisan serveこんなのを用意しておくと便利です。
"scripts": {
"serve": "php artisan serve & npm run watch-poll",
}
$ npm run serve


ディスカッション
コメント一覧
まだ、コメントがありません