esbuild-plugin-twig
v1.0.15
Published
ESBuild plugin to handle and build Twig files
Downloads
39
Maintainers
Readme
esbuild-plugin-twig
ESBuild plugin to handle and build Twig files.
CJS
and ESM
available.
Installation
PNPM
pnpm i twig esbuild-plguin-twig
NPM
npm i twig esbuild-plugin-twig
Yarn
yarn add twig esbuild-plugin-twig
Usage ESM
import Twig from 'twig'
import twigPlugin from 'esbuild-sass-twig'
esbuild
.build({
plugins: [
twigPlugin({
twig: Twig,
src: 'src/twig',
destination: 'public',
})
],
})
.catch((e) => console.error(e.message));
Usage CJS
const twigPlugin = require('esbuild-plugin-twig');
const Twig = require('twig')
esbuild
.build({
plugins: [
twigPlugin({
twig: Twig,
src: 'src/twig',
destination: 'public',
})
],
})
.catch((e) => console.error(e.message));
Options
| Option | Type | Default | Required | | ------------- | --------------------- | ------------- | -------- | | twig | Imported twig package | Empty | yes | | src | string | src/twig | no | | destination | string | public | no |