Skip to content

Hook into the Vite build #4

Closed
Closed

Description

@n4ff4h

A Vite plugin that regenerates translations on vite build and watches lang/ in dev with HMR, so developers never run the export by hand.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Decision: the plugin ships at vendor/javaabu/js-localization/dist/vite.js and works standalone, next to manifest():

    plugins: [laravel({ input: [...] }), manifest(), jsLocalization(), react()]

    manifest's plugin has no hook for package-provided Vite plugins yet; I asked for one in Javaabu/manifest#14. Once that lands, the provider registers the plugin with manifest and apps can drop the extra line. Nothing else changes, so this issue isn't blocked on it.

    Translations reach bundles as a virtual module (virtual:js-localization, one lazy chunk per locale) exported by php artisan lang:js --stdout, so nothing generated needs committing or gitignoring. write: true also keeps the files at js-localization.path current. Note: laravel-vite-plugin's refresh: true watches lang/** and reloads the page; list your refresh paths without lang/ to get updates without a reload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions