LoginSignup
1
0

More than 3 years have passed since last update.

laravel sailでbrowser-syncを使う、sail yarn watchを動かす

Posted at

解決法

以下のように、laravel.testのportsに3000を追加しました。

services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            dockerfile: Dockerfile
            args:
                WWWGROUP: "${WWWGROUP}"
        image: sail-8.0/app
        ports:
            - '${APP_PORT:-80}:80'
            - '3000:3000' ###ここを追加しました
        environment:
            WWWUSER: "${WWWUSER}"
            LARAVEL_SAIL: 1
        volumes:
            - ".:/var/www/html"
        networks:
            - sail
        depends_on:
            - mysql
            - redis

問題点

laravel sailで作ったアプリにbrowserSyncを使用しようとしました。
しかし、sail yarn watch実行時に表示されるhttp://localhost:3000にアクセスしても何も表示されない。

実行ファイル

// webpack.mix.js
const mix = require("laravel-mix");

mix.browserSync("laravel.test");
1
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
1
0