Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apply-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apply-loader

Apply loader for webpack

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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");

Webpack 2 configuration

use: [{
  loader: 'apply-loader',
  options: {
    // => sourceFn({a: 1}, true)
    args: [ {a: 1}, true ]
    // => sourceFn({a: 1})
    obj: {a: 1}
    // => sourceFn(require('webpack.config').customConfig)
    config: 'customConfig'
  }
}

License

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

Keywords

FAQs

Package last updated on 28 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc