{"id":25466,"library":"esbuild-xyaml-plugin","title":"esbuild-xyaml-plugin","description":"An esbuild plugin for loading and transforming XYAML files. Version 0.0.7 is the current stable release. This plugin allows importing XYAML files directly into JavaScript/TypeScript bundles built with esbuild. It integrates with esbuild's build pipeline, converting XYAML content to JavaScript objects or strings. As a community-maintained plugin, it fills a niche for projects using XYAML as a data format. Compared to generic YAML loaders, it is purpose-built for the XYAML schema. Release cadence is irregular. The plugin is distributed as a CommonJS module and requires esbuild as a peer dependency.","status":"active","version":"0.0.7","language":"javascript","source_language":"en","source_url":"https://github.com/teniryte/esbuild-xyaml-plugin","tags":["javascript"],"install":[{"cmd":"npm install esbuild-xyaml-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-xyaml-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-xyaml-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required to integrate as a plugin.","package":"esbuild","optional":false}],"imports":[{"note":"The package is CommonJS only; ESM import will fail unless using a bundler that interops.","wrong":"import xyamlPlugin from 'esbuild-xyaml-plugin';","symbol":"default","correct":"const xyamlPlugin = require('esbuild-xyaml-plugin');"},{"note":"When using a bundler or TypeScript with esModuleInterop, named default import works.","symbol":"default","correct":"import xyamlPlugin from 'esbuild-xyaml-plugin';"}],"quickstart":{"code":"const esbuild = require('esbuild');\nconst xyamlPlugin = require('esbuild-xyaml-plugin');\n\nesbuild.build({\n  entryPoints: ['./src/index.js'],\n  bundle: true,\n  outfile: './dist/app/app.js',\n  loader: {\n    '.js': 'jsx',\n  },\n  sourcemap: true,\n  target: ['chrome58', 'firefox57', 'safari11', 'edge16'],\n  define: {\n    'process.env.NODE_ENV': '\"development\"',\n  },\n  plugins: [xyamlPlugin()],\n}).catch(() => process.exit(1));","lang":"javascript","description":"Shows how to use the plugin with esbuild's build API, including loader configuration and plugin registration."},"warnings":[{"fix":"Call the imported default export: xyamlPlugin()","message":"The plugin must be invoked as a function (e.g., xyamlPlugin()) to create the plugin object, not passed as a reference.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use require() or configure your bundler to handle CJS interop.","message":"The package is CommonJS only; using ESM import without bundler support may fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"None.","message":"No breaking changes reported for this version.","severity":"breaking","affected_versions":">=0.0.7"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure you import the module correctly and invoke it: const xyamlPlugin = require('esbuild-xyaml-plugin'); ... plugins: [xyamlPlugin()]","cause":"Importing the default export incorrectly or forgetting to call the plugin factory.","error":"TypeError: xyamlPlugin is not a function"},{"fix":"Install esbuild: npm install --save-dev esbuild","cause":"esbuild is not installed.","error":"Error: Cannot find module 'esbuild'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}