Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
apply-loader
✓ const apply = require('apply-loader');
✗ import apply from 'apply-loader';
This is a webpack loader, not a JS module. It is used in webpack config, not imported in application code.
Use in webpack config (webpack 1)
✓ { test: /\.js$/, loader: 'apply-loader?args[]=1' }
✗ { test: /\.js$/, use: 'apply-loader?args[]=1' }
In webpack 1, use 'loader'; in webpack 2+, use 'use' with options object.
Use in webpack config (webpack 2+)
✓ { test: /\.js$/, use: { loader: 'apply-loader', options: { args: [1] } } }
✗ { test: /\.js$/, loader: 'apply-loader?args[]=1' }
Webpack 2+ prefers options object over query string.
Configures apply-loader to invoke greet.js with arguments and export the return value.
// webpack.config.js
module.exports = {
entry: './app.js',
output: { filename: 'bundle.js' },
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'apply-loader',
options: {
args: ['hello', { foo: 'bar' }]
}
}
}
]
}
};
// greet.js (target module)
function greet(greeting, options) {
return `${greeting} ${options.foo}`;
}
module.exports = greet;
// Result: bundle exports 'hello bar'
Errors
Common errors & fixes
Error: apply-loader?args[]=1: The provided value "args[]" is not a valid request parameter.
Using query string syntax with webpack 2+ without proper encoding or using 'use' array incorrectly.
fixUse options object: { loader: 'apply-loader', options: { args: [1] } } Module build failed: TypeError: apply is not a function
Target module does not export a function (exports an object, string, etc.).
fixEnsure the target module exports a function: module.exports = function(...) {...} Audit
Dependencies
No dependency data recorded yet.