kokoal / vite-plugin-drupal-template-hmr

A ViteJS plugin that leverage HMR API and Drupal template comments to do HMR on template update.
MIT License
2 stars 0 forks source link

Converting circular structure to JSON #1

Open DieterHolvoet opened 6 months ago

DieterHolvoet commented 6 months ago

I'm trying out this plugin, but I can't get it to work. When a HMR happens, the following error is displayed:

CleanShot 2024-03-25 at 16 03 30

kokoal commented 5 months ago

Hello, how do you add the plugin in a vite.config.js/ts file ?

Maybe try adding it while defining the vite config like this example :

import { defineConfig } from 'vite';
import viteDrupalTemplateHMR from "vite-plugin-drupal-template-hmr"

export default defineConfig({
  base: '/themes/custom/default/dist',
  plugins: [
    viteDrupalTemplateHMR({
      templateBase: 'themes/custom/default/',
    }),
  ],

...
});