vite-plugin-logseq

raw JSON →
1.1.2 verified Mon Apr 27 auth: no javascript maintenance

A Vite plugin for Logseq plugin development that fixes HMR issues by providing a valid index.html and reloading plugins when updates fall outside the UI framework's HMR boundary. Current stable version is 1.1.2, last updated in April 2022. It is a niche tool specifically for Logseq plugin developers using Vite. Differentiators: it handles the unique development workflow for Logseq plugins, solving HMR mismatches that standard Vite setups cannot.

error Error: [vite-plugin-logseq] Unable to find index.html in root directory
cause Missing or misconfigured root directory for Logseq plugin.
fix
Ensure your Vite root is set to the Logseq plugin directory containing an index.html.
error TypeError: logseqPlugin is not a function
cause Named import used instead of default import.
fix
Use default import: import logseqPlugin from 'vite-plugin-logseq'
gotcha Plugin must be placed after other plugins that handle HMR to avoid interference.
fix Ensure logseqPlugin() is the last plugin in the plugins array.
breaking Default open behavior disabled in v1.1.1; browser no longer opens automatically.
fix If you need automatic open, configure via plugin options or use Vite's open option.
deprecated Package is in maintenance mode with no updates since April 2022.
fix Consider alternative if issues arise; not actively maintained.
npm install vite-plugin-logseq
yarn add vite-plugin-logseq
pnpm add vite-plugin-logseq

Shows how to add the logseqPlugin to a Vite config to enable HMR for Logseq plugin development.

// vite.config.ts
import { defineConfig } from 'vite'
import logseqPlugin from 'vite-plugin-logseq'

export default defineConfig({
  plugins: [
    logseqPlugin()
  ]
})