Registry / web-framework / rollup-plugin-dot

rollup-plugin-dot

JSON →
library1.1.0jsnpmunverified

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.

npm install rollup-plugin-dot
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-DOT
R
rollup-plugin-dot
web-frameworkjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import dot from 'rollup-plugin-dot'
import { dot } from 'rollup-plugin-dot'
The package exports a default function; named import will result in undefined.
dot
const dot = require('rollup-plugin-dot')
const { dot } = require('rollup-plugin-dot')
CommonJS require returns the default export directly, not an object.
DotPluginOptions
import type { DotPluginOptions } from 'rollup-plugin-dot'
TypeScript type exported for plugin options, useful for custom configs.

Shows basic rollup-plugin-dot setup with include pattern, template settings, and defines.

// rollup.config.js import dot from 'rollup-plugin-dot'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'iife', }, plugins: [ dot({ include: ['**/*.dot'], templateSettings: { strip: false }, defines: { env: process.env.NODE_ENV || 'development', }, }), ], };
Debug
Known issues
gotchaDefault Export Only; Named Import Fails Silently
fix
Use default import: `import dot from 'rollup-plugin-dot'`
affects: >=1.0.0
gotchaExports Undefined if Named Export Used
fix
Use default import: `import dot from 'rollup-plugin-dot'`
affects: >=1.0.0
gotchaRequire Returns Function Directly, Not an Object
fix
Use `const dot = require('rollup-plugin-dot')` instead of destructuring
affects: >=1.0.0
gotchaOnly .dot Files Processed by Default
fix
Add `include: ['**/*.tpl']` to process .tpl files
affects: >=1.0.0
gotchaTemplate Settings Are Passed to doT Compiler; Typos Not Validated
fix
Ensure templateSettings keys match doT documentation exactly
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not load ... (imported by ...): Cannot find module 'dot'
Missing doT runtime dependency; 'dot' is a peer dependency.
fix
Run `npm install -D dot` or `yarn add -D dot`
TypeError: dot is not a function
Using named import `import { dot } from 'rollup-plugin-dot'` instead of default.
fix
Use `import dot from 'rollup-plugin-dot'`
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
Rollup cannot process .dot files without the plugin.
fix
Add the dot plugin to the plugins array in rollup.config.js
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
dotrequiredCompiles doT templates at build time.
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
rollup-plugin-dot — npm install rollup-plugin-dot · libregistry