1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How can I disable file splitting when compiling via Vite?

Discussão em 'Outras Linguagens' iniciado por Denis Chenykh, Novembro 7, 2024 às 13:32.

  1. I have Laravel installed and there is a config like this

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

    export default defineConfig(({ mode }) => {
    return {
    plugins: [
    laravel({
    input: [
    /// Heaps of files are being connected
    ],
    refresh: true,
    })
    ],
    build: {
    outDir: 'public/build',
    minify: 'esbuild',
    modulePreload: false,
    polyfillModulePreload: false,
    sourcemap: mode !== 'production',
    terserOptions: {
    compress: {
    drop_console: mode === 'production',
    },
    output: {
    comments: mode === 'production',
    },
    },
    },
    }
    });


    `

    And I want one file to be compiled and output, but now I have a file with this connection @vite(['resources/js/client/pages/client/sale/sale.js']) and I want him to be the only one connected, but I'm past connecting him, that's all that's going on

    <link rel="modulepreload" href="https://hitno.local/build/assets/constant-jYRDAREv.js"> <link rel="modulepreload" href="https://hitno.local/build/assets/init-swiper-CYD-sbV2.js"> <link rel="modulepreload" href="https://hitno.local/build/assets/pagination-BSD8aAhp.js"> <script type="module" src="https://hitno.local/build/assets/sale-CrTjuH8L.js"></script>

    And I wish I didn't have a preload module at all, but just connected one file that I specified

    I tried to figure it out on my own, but apart from the module Preload and polyfillModulePreload parameters, I didn't really find anything, but they don't help

    Continue reading...

Compartilhe esta Página