Closed jericopulvera closed 6 years ago
I believe this comes from the base laravel package and has never worked for this boilerplate as far as I know. For this package it is recommended to use something like Homestead, Vagrant or Valet.
I used Laravel Homestead and Valet together in a Linux machine.
npm run hot works on normal freshly installed Laravel projects but not on Laravel boilerplate that's why I opened this issue.
It is working for me though what are the files you are changing, maybe we could reproduce the issue. It looks like it can't seem to write to the public folder
EDIT: I answered wrongly before. Even though we never use it for the development, it seems to work for me
I am changing the example component.
What I did was
Yeah this seems to be a issue with mix.version()
in the webpack.config.js
.
EDIT: Found a issue on the laravel-mix repo: https://github.com/JeffreyWay/laravel-mix/issues/1176
Try to make the file like this and see if that works:
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.sass('resources/assets/sass/frontend/app.scss', 'public/css/frontend.css')
.sass('resources/assets/sass/backend/app.scss', 'public/css/backend.css')
.js('resources/assets/js/frontend/app.js', 'public/js/frontend.js')
.js([
'resources/assets/js/backend/before.js',
'resources/assets/js/backend/app.js',
'resources/assets/js/backend/after.js'
], 'public/js/backend.js');
if(mix.inProduction){
if (process.env.npm_lifecycle_event !== 'hot') {
mix.version()
}
}
That fixed it. Thanks
I pushed a fix to the master branch that is a bit cleaner :) Good luck with further development
@Shuyinsama
Your code has a bug.
mix.inProduction
is true, because it's a function.
It working for me.
if (mix.inProduction()) {
if (process.env.npm_lifecycle_event !== 'hot') {
mix.version()
}
}
And thank you.
How to run this in hot reload?
npm run hot
I get this error when I save a changes
Version: Laravel 5.5 Boilerplate