arnoson / vite-plugin-live-reload

A simple live reloading plugin for vite.
86 stars 3 forks source link

No working in VITE 5.0 #9

Closed VigilioYonatan closed 11 months ago

VigilioYonatan commented 11 months ago

No problem with vite 4.. No reloading my views js. but in terminal show changes

import { defineConfig, splitVendorChunkPlugin } from "vite";
import liveReload from "vite-plugin-live-reload";
import preact from "@preact/preset-vite";
import million from "million/compiler";
import path from "path";
import dotenv from "dotenv";
dotenv.config();

export default defineConfig({
    plugins: [
        liveReload([path.resolve(__dirname, "./resources/views/**/*.ejs")]),
        splitVendorChunkPlugin(),
        million.vite({ mode: "preact" }),
        preact(),
    ],
    root: "resources",
    base: "/dist/",
    resolve: {
        // RESOURCES ALIAS
        alias: {
            "@": path.resolve(__dirname, "resources", "ts", "services"),
            "~": path.resolve(__dirname, "resources", "ts"),
        },
    },
    build: {
        outDir: path.resolve(__dirname, "public", "dist"),
        emptyOutDir: true,
        manifest: true,
        rollupOptions: {
            input: path.resolve(__dirname, "resources", "ts", "main.ts"),
        },
    },
    server: {
        strictPort: true,
        port: Number(process.env.VITE_PORT),
        host: true,
    },
});

dependencies "vite": "^5.0.2", "vite-plugin-live-reload": "^3.0.2",

arnoson commented 11 months ago

I just created a new release that has vite 5 as its peer dependency, does this solve your problem? For me everything is working as expected with vite 5, since none of the changes between vite 4 and 5 should affect this plugin. If you still have problems, please provide a minimal code sandbox example

VigilioYonatan commented 11 months ago

latest version it found. thanks for all. greetings