Skip to content

[0.3.x] Add app/View/Components/** to default refresh paths#55

Merged
timacdonald merged 3 commits intomainfrom
vite-components
Jul 5, 2022
Merged

[0.3.x] Add app/View/Components/** to default refresh paths#55
timacdonald merged 3 commits intomainfrom
vite-components

Conversation

@timacdonald
Copy link
Member

@timacdonald timacdonald commented Jul 2, 2022

This PR adds app/View/Components/** to the global default directories to watch and perform full page reloads for. This is useful as View Components may be entirely specified in the class itself with no blade file.

Additionally, it also exports the default directories so users can utilise the default list and just add their own. Here would be an example of he export usage...

import { defineConfig } from 'vite';
import laravel, { refreshPaths } from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/js/app.js',
            ],
            refresh: [
                ...refreshPaths,
                'app/Http/Livewire/**'
            ],
        }),
    ],
});

@timacdonald timacdonald requested a review from jessarcher July 2, 2022 07:16
Copy link
Member

@jessarcher jessarcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dig the export :)

@timacdonald timacdonald merged commit cb54075 into main Jul 5, 2022
@timacdonald timacdonald deleted the vite-components branch July 5, 2022 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants