esbuild-plugin-pug

Import plugin for pug (and jade) files for esbuild

Install

npm i -D esbuild-plugin-pug

Use

const pugPlugin = require('esbuild-plugin-pug');

require('esbuild')
  .build({
    entryPoints: ['src/index.ts'],
    bundle: true,
    platform: "node",
    outfile: 'built/pug.js',
    plugins: [
      pugPlugin()
    ],
  })
  .catch(() => process.exit(1));