lazabogdan / webpack-query-string

Simple helper for creating query string parameters compatible with webpack loaders query syntax.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack-query-string

Install

npm install lazabogdan/webpack-query-string

Usage

Pass in the object to convert to a query string as the first parameter and any other optional qs options. Returns a query string.

function(fromObject, [options]) -> String

Example

var qs = require('webpack-query-string');

// webpack.config.js

loaders: [
	{
		test: /\.html$/, 
		loader: 'html?' + qs({
			attrs: [
				'img:src', 
				'some-element:src', 
				'some-other-element:src'
			]
		})
	}
]

// will return 
// attrs[]=img:src&attrs[]=some-element:src&attrs[]=some-other-element:src

About

Simple helper for creating query string parameters compatible with webpack loaders query syntax.


Languages

Language:JavaScript 100.0%