Commit bbeb7e60 authored by Laureline Nevin's avatar Laureline Nevin ⌨️
Browse files

Disabled HRM for js/ts files (full reload)

parent c0564758
Loading
Loading
Loading
Loading
+12 −4
Changes for vite.config.ts: 12 added lines, 4 removed lines.
Original line number Diff line number Diff line
import glsl from 'vite-plugin-glsl';
import ViteYaml from '@modyfi/vite-plugin-yaml';
import {defineConfig} from 'vite';
import checker from "vite-plugin-checker";
import { defineConfig, HmrContext } from 'vite';
import checker from 'vite-plugin-checker';


// noinspection JSUnusedGlobalSymbols
const disableFullReload = {
    name: 'disableFullReload',
    handleHotUpdate({ modules }: HmrContext) {
        return modules.filter((m) => !m.file || m.file.match(/\.(js|ts)$/) === null);
    },
};

export default defineConfig({
    plugins: [glsl(), ViteYaml(), checker({
        typescript: true,
    })],
    }), disableFullReload],
    worker: {
        format: 'es',
        plugins: () => [glsl()],
    },
    server: {
        // hmr: false, // Uncomment to disable hot reload
        proxy: {
            '/demo': {
                target: 'http://localhost/ivoire-datasets/',