Registry / devops / unlazy-loader

unlazy-loader

JSON →
library0.1.3jsnpmunverified

Webpack loader that transforms source files using lazy-cache into files that require modules directly, effectively 'unlazy-ing' cached requires for bundling. Version 0.1.3, last updated in 2016, no recent releases. Intended for use with webpack and the deprecated lazy-cache pattern. Limited documentation, no tests visible, and no maintenance activity. Alternatives like babel-plugin-lazy-cache or direct imports are recommended.

npm install unlazy-loader
INSTALL
IMPORT
SIG · UNLAZY-LOADER
U
unlazy-loader
devopsjavascriptv0.1.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

unlazy-loader (webpack rule configuration)
module.exports = { module: { rules: [ { test: /\.js$/, use: 'unlazy-loader' } ] } }
module.exports = { module: { loaders: [ { test: /\.js$/, loader: 'unlazy' } ] } }
Webpack v1 uses 'loaders' and 'loader' (string); v2+ uses 'rules' and 'use'. The documentation uses v1 style.
lazy-cache
import lazyCache from 'lazy-cache'; const lazy = lazyCache(require); const foo = lazy('foo');
const lazy = require('lazy-cache')(require); const foo = lazy('foo');
This loader is designed to transform lazy-cache calls; it does not replace the import itself.
webpack configuration (module.rules)
{ test: /\.js$/, use: 'unlazy-loader' }
{ test: /\.js$/, loader: 'unlazy' }
In webpack v4+, 'loader' is deprecated in favor of 'use'. The short name 'unlazy' works if resolveLoader is configured, but explicit 'unlazy-loader' is safer.

Basic webpack configuration to apply unlazy-loader to all JavaScript files, transforming lazy-cache requires into direct requires.

// webpack.config.js const path = require('path'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, module: { rules: [ { test: /\.js$/, use: 'unlazy-loader' } ] } };
Debug
Known issues
deprecatedPackage is effectively unmaintained since 2016. No updates for Node.js or webpack compatibility. Use at your own risk.
fix
Consider using babel-plugin-lazy-cache or manually converting lazy-cache calls to direct imports.
affects: all
breakingWebpack v2+ changed loader configuration syntax. Using old 'loaders' array and 'loader' property may fail silently or produce errors.
fix
Update webpack config to use 'rules' array and 'use' property.
affects: >=0.1.0
gotchaThe loader expects lazy-cache to be used with require context (commonjs). It may not work with ES module imports.
fix
Ensure your source files use CommonJS require pattern for lazy-cache (e.g., const lazy = require('lazy-cache')(require)).
affects: all
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'unlazy-loader'
unlazy-loader is not installed or not resolved correctly.
fix
Run 'npm install unlazy-loader --save-dev' and ensure it's in the project's node_modules.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
Using webpack v2+ with 'loaders' array instead of 'rules' array.
fix
Change 'module.loaders' to 'module.rules' and 'loader' to 'use' in webpack config.
lazy-cache requires a require function to be passed
The lazy-cache function was not called with the require context; this loader expects specific usage.
fix
Ensure you use 'const lazy = require('lazy-cache')(require)' in your source files.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
webpackrequiredRequired as peer dependency; this is a webpack loader.
lazy-cacheoptionalThe loader transforms files that use lazy-cache; lazy-cache should be a dependency of the project.
Agent activity
4 hits · last 30 days
node
4
Resources
unlazy-loader — npm install unlazy-loader · libregistry