0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravel 開発環境構築 備忘録2 laravel mixの設定

Posted at

Laravelに同梱されてるlaravel mixの設定まで。

まずはVM内で走らせてみる

vagrant ssh
cd /home/vagrant/code/myproject/
npm install
npm run dev

コンパイルはOK。

npm run watch

このままだとエラーを吐く。cross-envが無いらしいのでインストール。

npm install --save-dev cross-env

そしてwatch。
VM上だとwatch-pollとする必要があるそう。

npm run watch-poll

成功。VM上なのでブラウザを開かないため、手動で、、
なおbrowsersyncにはポートが必要になる。

http://myproject.test:3000/

一見成功。
しかし、コンパイルに時間かかる。。。
さらに、viewsの変更には反応しない。。。
これではちょっと使えない。

VMに入らず、ローカルのディレクトリ上で走らせてみる

node_modulesは再度インストールしなおす

exit
cd myproject
rm -R node_modules/
npm install

そして実行。

npm run watch

ちゃんとviesにも反応。
しかも早いくて快適!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?