chrisd

Oct 13th, 2024 08:50 PM

Hi I'm trying to get live realoading to work. But I think the problem is that WebPack is running in the themes folder and doesn't watch other files.

https://laravel-mix.com/docs/6.0/livereload

  • with script loading at the bottom of the app layout

Installed another one for webpack 5 support

npm install --save-dev @kooneko/livereload-webpack-plugin

I cannot see how to force it to watch files in other folders.

Tried this config, but doesn't work

mix.webpackConfig({
    plugins: [new LiveReloadPlugin({
        files: [
            '../../../../../../**/*.php',
            '../../../../../../**/*.js',
            '../../../../../../**/*.css',
            '../../../../../../**/*.scss',
            '../../../../../../**/*.json',
        ],
    })]
});

Has anyone got Live Reload working in Wave 2 ?

PS: I usually run latest Laravel that has Vite and all the goodies already enabled. Now I'd like to keep that process as I'm used to it.

bobbyiliev

Oct 14th, 2024 12:41 AM

Hey Chris,

As discussed in your other question here, that you've replaced the theme:: helper the full path to the file, you should be able to set up live reloading just like a standard Laravel application and not rely on the theme:: helper and the theme folder.

Will this work for you?

- Bobby

chrisd

Oct 14th, 2024 03:57 AM

Hi Bobby,

To use it like I normally do, I'm imagining this...

I set up the app like the default Laravel 10 install - With Vite + Tailwind from the root.

Then copy stuff over from themes/tallstack/packages.json and themes/tallstack/tailwind.config.js (that's missing in default L10 files)

Run npm install and use normal npm run dev from the root

Would that work?

bobbyiliev

Oct 14th, 2024 07:19 AM

Hi there,

You would still be able to do npm run watch with the current setup but you would need to run the command in the theme directory.

If you prefer to set it up as a standard Laravel project, yes, you would need to get the package.json file from the theme's directory and also get the static assets from there too, eg resources/views/themes/tailwind/assets/*.

- Bobby

Report
1