{"id":25044,"library":"bun-plugin-dlight","title":"bun-plugin-dlight","description":"Bun build plugin for transpiling DLight views and models (.view.js/.view.ts files) inside Bun's bundler. v0.5.0, stable, with TypeScript types. Integrates directly into Bun.build() using Babel under the hood, without requiring Vite or Astro. Supports custom file filters and DLight preset options. Designed for Bun + DLight projects that want minimal tooling overhead.","status":"active","version":"0.5.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","dlight.js","bun-plugin","typescript"],"install":[{"cmd":"npm install bun-plugin-dlight","lang":"bash","label":"npm"},{"cmd":"yarn add bun-plugin-dlight","lang":"bash","label":"yarn"},{"cmd":"pnpm add bun-plugin-dlight","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency: plugin only works with Bun's Bun.build() API","package":"bun","optional":false},{"reason":"Transpilation target: processes DLight view/model files","package":"@dlightjs/dlight","optional":true}],"imports":[{"note":"Named export only; no default export available.","wrong":"import dlightPlugin from 'bun-plugin-dlight'","symbol":"dlightPlugin","correct":"import { dlightPlugin } from 'bun-plugin-dlight'"},{"note":"Type export; use import type in TypeScript.","wrong":"const DLightPluginOptions = require('bun-plugin-dlight').DLightPluginOptions","symbol":"DLightPluginOptions","correct":"import { DLightPluginOptions } from 'bun-plugin-dlight'"},{"note":"Type-only export for advanced usage; not needed in most cases.","wrong":null,"symbol":"PluginBuilder","correct":"import type { PluginBuilder } from 'bun-plugin-dlight'"}],"quickstart":{"code":"import { dlightPlugin } from 'bun-plugin-dlight';\n\nconst result = await Bun.build({\n  outdir: './dist',\n  entrypoints: ['./src/index.ts'],\n  publicPath: '/build/',\n  throw: true,\n  plugins: [\n    dlightPlugin({\n      filter: /\\.(view|model)\\.[tj]s$/,\n      options: {}\n    }),\n  ],\n});\n\nconsole.log('Build output:', result.outputs);","lang":"typescript","description":"Shows how to import and use dlightPlugin inside Bun.build() with custom filter and options."},"warnings":[{"fix":"Ensure you run the code with Bun and use Bun.build().","message":"Plugin only works with Bun's Bun.build() API, not with other bundlers or runtimes.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Avoid overriding Babel globally; rely on Bun's internal Babel.","message":"Requires Babel to be installed (comes bundled with Bun, but if custom Babel config is needed, it may conflict).","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use import { dlightPlugin } from 'bun-plugin-dlight' instead of require().","message":"In v0.5.0, the plugin switched from CommonJS to ESM-only; require() no longer works.","severity":"breaking","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import { dlightPlugin } from 'bun-plugin-dlight'.","cause":"Importing default export instead of named export.","error":"TypeError: dlightPlugin is not a function"},{"fix":"Run 'bun add bun-plugin-dlight' to install.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'bun-plugin-dlight'"},{"fix":"Ensure you call dlightPlugin() as a function: plugins: [dlightPlugin()].","cause":"Passing an invalid plugin object (e.g., forgetting to call dlightPlugin()).","error":"Bun.build: Plugin must be an object with a `name` property."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}