Skip to content

varunvs/apply-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apply loader for webpack

Usage

Documentation: Using loaders

The apply loader can be used to execute an exported JavaScript function (optionally with arguments) and export the returned value.

It will attempt to call the default export if defined, falling back to the basic export (i.e. module.exports).

// Call with multiple arguments
// => sourceFn(1, 2)
require("apply?args[]=1&args[]=2!functionReturningLoader");

// Call with an object/array
// => sourceFn({a: 1, b:2})
require("apply?{obj: {a: 1, b: 2}}!functionReturningLoader");

// Call with an object/array declared in the webpack.config
// => sourceFn(require('webpack.config').customConfig)
require("apply?config=customConfig!functionReturningLoader");

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

Apply loader for webpack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%