Skip to content

Hot file should be stored in build directory #24

@hailwood

Description

@hailwood
  • Laravel Vite Plugin Version: 0.2.2
  • Laravel Version: 9.17.0
  • Node Version: 18.0.0
  • NPM Version: 8.6.0

Description:

Right now we're storing the hot file directory in the public directory.
What this means is that if we have multiple devservers running they're going to fight over that hot file.

Instead I'm thinking we should probably be joining the build directory onto the path,
this would mean each devserver would have it's own hotFile location.

I.e. lines like

const hotFile = path.join(pluginConfig.publicDirectory, 'hot');

become

const hotFile = path.join(pluginConfig.publicDirectory, pluginConfig.buildDirectory, 'hot');

This would also require an update to the PR open in Laravel so it takes the build directory into account when looking for the hot file.

https://github.com/laravel/framework/pull/42785/files#diff-46c2ed8e094afc518af68102faf85711f7b73426e3ce8c339b087523ba9ee4c7R27

In the stock standard setup all it means is the hot file would end up in public/build/hot instead of public/hot

Steps To Reproduce:

  1. Have multiple build process (e.g. resources/frontend/vite.config.js and resources/backend/vite.config.js)
  2. Attempt to run the devserver (vite) from both at the same time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions