A webpack module to load XML files.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Update README, and restrict .gitignore to project-level excludes Feb 10, 2016
index.js Fixed #4 undefined error accessing options Mar 13, 2017
package.json v1.2.1 Mar 13, 2017


Webpack XML loader

A Webpack plugin for loading XML files.


Install via npm:

npm install --save xml-loader


You can require XML data like this:

var data = require('xml!./data.xml');
// => returns data.xml content as json-parsed object

var data = require('xml?explicitChildren=true!./data.xml');
// => returns data.xml content as json-parsed object and put child elements to separate properties

The loader will translate the data.xml file into a JSON Object. node-xml2js processors are supported via query syntax.

Usage with webpack.config

To require XML files like this: require('data.xml') , you can add the xml-loader to your webpack config:

module : {
  loaders : [
    { test: /\.xml$/, loader: 'xml-loader' } // will load all .xml files with xml-loader by default