{"id":25415,"library":"esbuild-plugin-toml","title":"esbuild-plugin-toml","description":"An esbuild plugin to load TOML files during bundling. Version 0.0.1 is the initial and only release, with no updates since 2021. The package is lightweight and depends on esbuild's plugin API, providing a simple setup. Compared to alternatives like @toml-tools/loader, it is minimal but lacks customization options (e.g., no support for custom parsing or multiple file patterns). It is designed for basic TOML loading use cases.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/SilentVoid13/esbuild-plugin-toml","tags":["javascript"],"install":[{"cmd":"npm install esbuild-plugin-toml","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-toml","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-toml","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for plugin API","package":"esbuild","optional":false}],"imports":[{"note":"Package does not export a named function; default import is correct in ESM.","wrong":"const toml = require('esbuild-plugin-toml')","symbol":"toml","correct":"import toml from 'esbuild-plugin-toml'"},{"note":"CommonJS require returns the plugin function directly, not as named export.","wrong":"const { toml } = require('esbuild-plugin-toml')","symbol":"default","correct":"const toml = require('esbuild-plugin-toml')"},{"note":"Default import is the plugin function; no named exports.","symbol":"toml","correct":"import toml from 'esbuild-plugin-toml'"}],"quickstart":{"code":"// esbuild.config.js\nconst esbuild = require('esbuild');\nconst tomlPlugin = require('esbuild-plugin-toml');\n\nesbuild.build({\n  bundle: true,\n  entryPoints: ['main.js'],\n  outfile: 'out.js',\n  plugins: [tomlPlugin()],\n}).catch(() => process.exit(1));\n\n// main.js\nconst config = require('./config.toml');\nconsole.log(config);","lang":"javascript","description":"Shows how to set up esbuild with the TOML plugin and import a TOML file in JavaScript."},"warnings":[{"fix":"Ensure your TOML files have the .toml extension, or consider using a different plugin if custom extensions are needed.","message":"The plugin only handles .toml files; other extensions are ignored.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Check compatibility with your esbuild version. If using esbuild >0.14, consider testing or using an alternative plugin.","message":"Package has not been updated since 2021; may not support newer esbuild versions.","severity":"deprecated","affected_versions":"0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure tomlPlugin() is added to the plugins array in esbuild.build options.","cause":"Missing esbuild plugin configuration or plugin not registered.","error":"Error: No loader is configured for \".toml\" files"},{"fix":"Use `const tomlPlugin = require('esbuild-plugin-toml')` then call `tomlPlugin()`.","cause":"Incorrect import style; toml is the default export (a function) but was used as an object.","error":"TypeError: toml is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}