lhapaipai / vite-bundle

Integration with your Symfony app & Vite

Home Page:https://symfony-vite.pentatrion.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pentatrion\ViteBundle\Asset\EntrypointsLookup::getLegacyJSFile(): Return value must be of type string, array returned

plfort opened this issue · comments

commented

Hello,
I get this error with @vitejs/plugin-legacy.

It seems that the target value is an array with keys path and hash.
image

vite: 4.4.9
@vitejs/plugin-legacy: 4.1.1

import {defineConfig, splitVendorChunkPlugin} from 'vite'
import vue from '@vitejs/plugin-vue'
import symfonyPlugin from "vite-plugin-symfony";
import {resolve} from 'path';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import legacy from '@vitejs/plugin-legacy'
export default defineConfig({
        plugins: [
            vue(),
            splitVendorChunkPlugin(),
            VueI18nPlugin({
                strictMessage: false,
                include: resolve(__dirname, 'assets/locales/*.json'),
                jitCompilation: false,
            }),
            legacy({
                targets: ['defaults', 'not IE 11'],
            }),
            symfonyPlugin(),
        ],
        build: {
            target: 'es2020',
            manifest: true,
            rollupOptions: {
                input: {
                    app: './assets/app.ts',
             
                },
                output: {
                  chunkFileNames: "assets/[hash:15].js"
                },
            },
            outDir: "public/build",
        },
        resolve: {
            alias: {
                '~': resolve(__dirname, 'assets'),
                'vue': 'vue/dist/vue.esm-bundler.js',
            },
            extensions: ['.js', '.ts', '.vue', '.json']
        }
    }
)

Am i missing something ?