Skip to content

Custom manifest filename #110

@arthvrian

Description

@arthvrian

Laravel Vite Plugin Version: 0.5.2
Laravel Version: 9.19
Node Version: 16.16.0
NPM Version: 8.11.0
Vite : 3.0.3
Host operating system: Windows 10
Web Browser & Version: Brave 1.41 (Chromium 103)
Running in Sail / Docker: No

Description

Vite allows setting a custom manifest filename https://vitejs.dev/config/build-options.html#build-manifest because the default filename may conflict if you are building a PWA or Chrome extension or whatever

This option is overridden by this plugin (maybe here? https://github.com/laravel/vite-plugin/blob/main/src/index.ts#L105) and always overrides the manifest.json file

Config

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

export default defineConfig({
    build: {
        manifest: 'vite-manifest.json',
        emptyOutDir: false,
        outDir: "public/",
    },
    plugins: [
        laravel({
            buildDirectory: "./",
            input: [
                'resources/css/app.css',
                'resources/js/app.js',
            ],
        }),
    ],
});

Output with laravel plugin

> build
> vite build --config vite.config.js

vite v3.0.3 building for production...
✓ 58 modules transformed.
public/manifest.json             0.23 KiB
public/assets/app.4ee680d5.css   0.02 KiB / gzip: 0.04 KiB
public/assets/app.d81e8d40.js    90.63 KiB / gzip: 33.07 KiB

Output without laravel plugin

> build
> vite build --config vite.config.js

vite v3.0.3 building for production...
✓ 58 modules transformed.
public/vite-manifest.json        0.23 KiB
public/assets/app.4ee680d5.css   0.02 KiB / gzip: 0.04 KiB
public/assets/app.f223d706.js    90.63 KiB / gzip: 33.07 KiB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions