Let vite() take a build directory per call, like @vite(entries, 'build')

Open Beginner friendly
#864 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start with laravel::view::vite and the underlying Vite::build_dir API, as named in the issue. Add a per-call variant that accepts the build directory while preserving the request's nonce and settings. Done means callers can select a custom build directory for one call while the existing default behavior remains available.

Written by the indexing model from the issue text.

Description

In Laravel, @vite(['resources/js/app.js'], 'custom-build') (and Vite::useBuildDirectory) reads a different build directory per call, for apps with more than one Vite build. laravel::view::vite takes only the entries and always uses the default:

laravel::view::vite(["resources/js/app.js"], "custom-build");
// error[E0061]: this function takes 1 argument but 2 arguments were supplied

The underlying vite crate already supports it (Vite::build_dir); the framework creates the Vite value with its defaults. A variant such as vite_with(entries, build_dir) (keeping the request's nonce and settings) would cover it.

Context: found while porting Blade's @vite to a Laravel for Rust view engine (oxblade).

Dominant language
Rust
Stars
847
Forks
174
Avg merge
5h 40m
Merged PRs (30d)
167

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from laravel/rust-framework

All issues in laravel/rust-framework

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.