{"id":21988,"library":"rollup-plugin-dot","title":"rollup-plugin-dot","description":"Rollup plugin that compiles doT.js template files (.dot, .tpl) into JavaScript functions during bundling. Current stable version is 1.1.0. The plugin provides a seamless integration of doT templates with Rollup, enabling imports like `import view from './view.dot'`. It supports include/exclude patterns, custom doT template settings, and template defines. Key differentiators: minimal configuration, TypeScript type definitions included, and supports both .dot and .tpl extensions. Unlike alternatives, it focuses solely on doT without additional template engine overhead.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/nilennoct/rollup-plugin-dot","tags":["javascript","rollup-plugin","doT","typescript"],"install":[{"cmd":"npm install rollup-plugin-dot","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-dot","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-dot","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Compiles doT templates at build time.","package":"dot","optional":false}],"imports":[{"note":"The package exports a default function; named import will result in undefined.","wrong":"import { dot } from 'rollup-plugin-dot'","symbol":"default","correct":"import dot from 'rollup-plugin-dot'"},{"note":"CommonJS require returns the default export directly, not an object.","wrong":"const { dot } = require('rollup-plugin-dot')","symbol":"dot","correct":"const dot = require('rollup-plugin-dot')"},{"note":"TypeScript type exported for plugin options, useful for custom configs.","wrong":"","symbol":"DotPluginOptions","correct":"import type { DotPluginOptions } from 'rollup-plugin-dot'"}],"quickstart":{"code":"// rollup.config.js\nimport dot from 'rollup-plugin-dot';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife',\n  },\n  plugins: [\n    dot({\n      include: ['**/*.dot'],\n      templateSettings: { strip: false },\n      defines: {\n        env: process.env.NODE_ENV || 'development',\n      },\n    }),\n  ],\n};","lang":"javascript","description":"Shows basic rollup-plugin-dot setup with include pattern, template settings, and defines."},"warnings":[{"fix":"Use default import: `import dot from 'rollup-plugin-dot'`","message":"Default Export Only; Named Import Fails Silently","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use default import: `import dot from 'rollup-plugin-dot'`","message":"Exports Undefined if Named Export Used","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use `const dot = require('rollup-plugin-dot')` instead of destructuring","message":"Require Returns Function Directly, Not an Object","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add `include: ['**/*.tpl']` to process .tpl files","message":"Only .dot Files Processed by Default","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure templateSettings keys match doT documentation exactly","message":"Template Settings Are Passed to doT Compiler; Typos Not Validated","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install -D dot` or `yarn add -D dot`","cause":"Missing doT runtime dependency; 'dot' is a peer dependency.","error":"Error: Could not load ... (imported by ...): Cannot find module 'dot'"},{"fix":"Use `import dot from 'rollup-plugin-dot'`","cause":"Using named import `import { dot } from 'rollup-plugin-dot'` instead of default.","error":"TypeError: dot is not a function"},{"fix":"Add the dot plugin to the plugins array in rollup.config.js","cause":"Rollup cannot process .dot files without the plugin.","error":"Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}