Registry / devops / xml-webpack-plugin

xml-webpack-plugin

JSON →
library1.3.0jsnpmunverified

A webpack plugin (v1.3.0) that generates XML files using EJS templates. Supports Webpack 4.x and 5.x. Key differentiators: it integrates seamlessly into the webpack build pipeline, allows writing XML to the output path or project context path, and uses the popular EJS templating engine. The project is in maintenance mode with no recent updates.

npm install xml-webpack-plugin
INSTALL
IMPORT
SIG · XML-WEBPACK-PLUGIN
X
xml-webpack-plugin
devopsjavascriptv1.3.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.

XMLWebpackPlugin
const XMLWebpackPlugin = require('xml-webpack-plugin')
import XMLWebpackPlugin from 'xml-webpack-plugin'
Package does not ship ES modules; use CommonJS require.
XMLWebpackPlugin
const XMLWebpackPlugin = require('xml-webpack-plugin'); new XMLWebpackPlugin(options)
new XMLWebpackPlugin()
Constructor requires an options object with a 'files' array.
files array
files: [ { template: 'path/to/template.ejs', filename: 'output.xml' } ]
files: [ 'path/to/template.ejs' ]
Each file entry must be an object, not a string.

Shows basic setup: require the plugin, configure an XML file from an EJS template with custom delimiters.

const path = require('path'); const XMLWebpackPlugin = require('xml-webpack-plugin'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, plugins: [ new XMLWebpackPlugin({ files: [ { template: path.join(__dirname, 'template.ejs'), filename: 'output.xml', data: { message: 'Hello World' }, } ], options: { delimiter: '%', openDelimiter: '<', closeDelimiter: '>', }, }), ], };
Debug
Known issues
deprecatedPackage has not been updated in years; may be deprecated for use with newer webpack versions beyond 5.x.
fix
Consider using html-webpack-plugin with ejs-loader for XML generation.
affects: >=1.3.0
gotchaPlugin requires a 'files' array; passing an empty array or missing 'files' will cause the plugin to silently do nothing.
fix
Always provide at least one file object in the 'files' array.
affects: >=1.0.0
gotchaTemplate paths must be absolute; relative paths may not resolve correctly.
fix
Use path.join(__dirname, 'template.ejs') to generate absolute paths.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ejs'
ejs is not installed as a dependency
fix
npm install ejs --save-dev
TypeError: files is not iterable
The 'files' property is missing or not an array
fix
Ensure the plugin options include: { files: [...] }
TypeError: Cannot read property 'readFileSync' of undefined
The template file path does not exist or is not absolute
fix
Use an absolute path or ensure the file exists at the given relative path.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
webpackrequiredPeer dependency; requires webpack 4.x or 5.x
ejsrequiredEmbedded JavaScript templating engine used for XML templates
Agent activity
28 hits · last 30 days
node
22
OpenAI (training)
1
Resources
xml-webpack-plugin — npm install xml-webpack-plugin · libregistry