Registry / devops / webpack-plugin-ejs-minification

webpack-plugin-ejs-minification

JSON →
library1.0.2jsnpmunverified

A Webpack plugin that minifies EJS template files using html-minifier-terser, offering customizable minification options. Current stable version is 1.0.2 with no frequent releases. Its key differentiator is focusing specifically on EJS file minification within the Webpack pipeline, leveraging the popular html-minifier-terser library. Alternative solutions often require manual setup or separate tools.

npm install webpack-plugin-ejs-minification
INSTALL
IMPORT
SIG · WEBPACK-PLUGIN-EJS
W
webpack-plugin-ejs-minification
devopsjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

MinifyEJSContent
const MinifyEJSContent = require('webpack-plugin-ejs-minification')
import MinifyEJSContent from 'webpack-plugin-ejs-minification'
This package does not provide ESM exports; use CommonJS require.

Demonstrates basic usage with CommonJS require and Webpack plugin configuration.

const path = require('path'); const MinifyEJSContent = require('webpack-plugin-ejs-minification'); module.exports = { entry: 'index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, plugins: [ new MinifyEJSContent({ dirPath: path.resolve(__dirname, 'views'), minify: { minifyJS: true, removeComments: true } }), ] };
Debug
Known issues
gotchaPlugin does not support ESM imports; using import will fail.
fix
Use require() instead of import.
affects: >=1.0
gotchaEnsure dirPath points to a directory containing .ejs files, otherwise plugin silently skips.
fix
Verify directory exists and contains .ejs files.
affects: >=1.0
gotchaThe minify option directly passes to html-minifier-terser; unsupported options cause runtime errors.
fix
Check html-minifier-terser documentation for valid options.
affects: >=1.0
Errors
Common errors & fixes
TypeError: MinifyEJSContent is not a constructor
Using ESM import instead of require, or incorrect installation.
fix
Use const MinifyEJSContent = require('webpack-plugin-ejs-minification'); and ensure package is installed.
Error: Cannot find module 'html-minifier-terser'
Missing peer dependency html-minifier-terser.
fix
Run npm install html-minifier-terser --save-dev.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
html-minifier-terserrequiredperforms actual minification of EJS content
Agent activity
6 hits · last 30 days
node
6
Resources
webpack-plugin-ejs-minification — npm install webpack-plugin-ejs-minification · libregistry