Back to results
nilennoct/rollup-plugin-dot(opens in a new tab)
Language: TypeScript
rollup plugin to compile doT files
- stars
- 6
- watchers
- 0
- forks
- 0
- open issues
- 0
- Last updated
- 01/08/2019
Language: TypeScript
rollup plugin to compile doT files
rollup plugin to compile doT files.
view.dot
<p>{{= it.message }}</p>
main.js
import view from './view.dot'; let data = { message: 'Hello world' }; console.log(`Render result: ${view(data)}`);
yarn add -D rollup-plugin-dot // Or use npm npm install -D rollup-plugin-dot
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', '**/*.tpl'], // default to `**/*.dot` exclude: ['**/index.tpl'], // default to `undefined` templateSettings: { strip: false }, // doT template settings, default to doT's default settings defines: { // doT template defines, default to `undefined` env: process.env.NODE_ENV || 'development', }, }), ], };