Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.5.x] Support customising hot file / build path #118

Merged
merged 2 commits into from
Aug 25, 2022
Merged

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Aug 11, 2022

This PR introduces a new configuration option to specify the location of the hot file. This is really just an escape hatch from our normal conventions.

// vite.config.js

export default defineConfig({
    plugins: [
        laravel({
            hotFile: 'storage/vite.hot',
            // ...
        }),
    ],
});
// *.blade.php

{{ Vite::useHotFile(storage_path('vite.hot'))->withEntryPoints(['resources/js/app.js']) }}

This PR depends on: laravel/framework#43620

The ability to customise the build directory (as seen in the above linked PR) is already possible without the need for additional changes to the plugin:

// vite.config.js

export default defineConfig({
    plugins: [
        laravel({
            buildDirectory: 'foo/bar',
            // ...
        }),
    ],
});
// *.blade.php

{{ Vite::useBuildDirectory('foo/bar')->withEntryPoints(['resources/js/app.js']) }}

Note that by design the build directory is always relative to the public directory but the hot path is used as is.

@timacdonald timacdonald marked this pull request as ready for review August 22, 2022 03:13
@timacdonald
Copy link
Member Author

Documentation PR: laravel/docs#8146

@taylorotwell taylorotwell merged commit 8324ce3 into main Aug 25, 2022
@taylorotwell taylorotwell deleted the hot-build-paths branch August 25, 2022 13:13
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.

3 participants