question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hot file should be stored in build directory

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
timacdonaldcommented, Jun 23, 2022

It would also be cleared out when a build occurs, so you wouldn’t end up with a “hot” file in your built assets (as Vite always clears it out)

1reaction
timacdonaldcommented, Jun 23, 2022

Putting the hot file in the build directory by default is interesting as it would mean that the file would never end up in git if for whatever reason node doesn’t clean the file up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Storing object files in a build directory (Makefile)
I'm trying to store all my object files in a build directory. In the root folder I have my Makefile, and the following...
Read more >
What is build directory? - Ask Ubuntu
And yes, it is usually called build in various documentations, but it can be called anything. It's just a temporary directory. If the...
Read more >
Dealing with files - Learn web development | MDN
Choose a place to store your website projects. Inside your chosen place, create a new folder called web-projects (or similar). This is where...
Read more >
Output Management - webpack
Webpack will generate the files and put them in the /dist folder for you, but it doesn't keep track of which files are...
Read more >
Establishing a build environment | Android Open Source Project
This section describes how to set up your local work environment to build the Android source files. You must use Linux; building under ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found