GitXplorerGitXplorer
g

xml-loader

public
15 stars
6 forks
2 issues

Commits

List of commits on branch master.
Unverified
8bcb92a9a101244e77bcda76a25204ad1820b921

v1.2.1

ggisikw committed 8 years ago
Unverified
29b4ced962b148473bfc23780f71f8bdd6f3fd2f

Merge pull request #5 from MitchTalmadge/patch-1

ggisikw committed 8 years ago
Unverified
6dfbaf8aaf387c883260632fb7dff4adcefb2121

Fixed #4 undefined error accessing options

MMitchTalmadge committed 8 years ago
Unverified
f86931b9e1fcf20ea4da219af2fa916f58c2b56d

v1.2.0

ggisikw committed 8 years ago
Unverified
db0c5fc64078493b1e02c8ebc932a236384798e5

Merge pull request #3 from alampros/fix-loaderutils-deprecation-warning

ggisikw committed 8 years ago
Unverified
8b3d708dfe6950677300f1f15ea44ede78989db5

Use getOptions to parse options

aalampros committed 8 years ago

README

The README file for this repository.

Webpack XML loader

A Webpack plugin for loading XML files.

Installation

Install via npm:

npm install --save xml-loader

Usage

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
  ]
}

Credits