{"id":26589,"library":"vite-plugin-dlight-server","title":"Vite Plugin DLight Server","description":"Vite plugin that transpiles DLight.js JSX-like syntax for server-side rendering, enabling DLight components to be used in Vite-based projects. Current stable version is 0.9.21, with weekly releases. Integrates seamlessly with Vite's build pipeline, handling DLight template compilation and HMR. Key differentiator: provides server-side rendering support for DLight, complementing the client-side @dl-light/dlight plugin.","status":"active","version":"0.9.21","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","dlight.js","vite-plugin","typescript"],"install":[{"cmd":"npm install vite-plugin-dlight-server","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-dlight-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-dlight-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required to function as a Vite plugin","package":"vite","optional":false},{"reason":"runtime dependency: provides core DLight functionality","package":"@dl-light/dlight","optional":false}],"imports":[{"note":"ESM-only; CommonJS require is not supported.","wrong":"const vitePluginDLightServer = require('vite-plugin-dlight-server')","symbol":"default (plugin function)","correct":"import vitePluginDLightServer from 'vite-plugin-dlight-server'"},{"note":"Also available as a named export to match common naming conventions.","wrong":"import VitePluginDLightServer from 'vite-plugin-dlight-server'","symbol":"vitePluginDLightServer (named export)","correct":"import { vitePluginDLightServer } from 'vite-plugin-dlight-server'"},{"note":"TypeScript type import for plugin configuration.","wrong":"","symbol":"VitePluginConfig (type)","correct":"import type { VitePluginConfig } from 'vite-plugin-dlight-server'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport vitePluginDLightServer from 'vite-plugin-dlight-server';\nimport dlight from '@dl-light/dlight';\n\nexport default defineConfig({\n  plugins: [\n    vitePluginDLightServer(),\n    dlight()\n  ]\n});","lang":"typescript","description":"Shows how to add the DLight server plugin and client plugin to a Vite config."},"warnings":[{"fix":"Upgrade to Vite 4 or 5.","message":"Requires Vite 4+; incompatible with Vite 3.x.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Update to Node 16 or higher.","message":"Dropped support for Node.js 14; now requires Node 16+.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Reorder plugins: vitePluginDLightServer() first, then dlight().","message":"The plugin must be placed before @dl-light/dlight in the plugins array.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Replace server: true with ssr: true in plugin options.","message":"The 'server' option is deprecated; use 'ssr' option instead.","severity":"deprecated","affected_versions":">=0.8.0 <0.9.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade Vite: npm install vite@latest","cause":"Project uses Vite 3 which is incompatible with plugin version 0.9.0+.","error":"Error: The plugin 'vite-plugin-dlight-server' requires Vite 4 or higher."},{"fix":"Use ES6 import: import vitePluginDLightServer from 'vite-plugin-dlight-server'","cause":"Importing the plugin incorrectly due to ESM/CJS mismatch.","error":"TypeError: vitePluginDLightServer is not a function"},{"fix":"Install the package: npm install @dl-light/dlight","cause":"Missing dependency @dl-light/dlight which is required at runtime.","error":"Error: Cannot find module '@dl-light/dlight'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}