{"id":20641,"library":"unlazy-loader","title":"unlazy-loader","description":"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.","status":"deprecated","version":"0.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/doowb/unlazy-loader","tags":["javascript","cache","lazy","lazy-cache","loader","loading","unlazy","webpack"],"install":[{"cmd":"npm install unlazy-loader","lang":"bash","label":"npm"},{"cmd":"yarn add unlazy-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add unlazy-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as peer dependency; this is a webpack loader.","package":"webpack","optional":false},{"reason":"The loader transforms files that use lazy-cache; lazy-cache should be a dependency of the project.","package":"lazy-cache","optional":true}],"imports":[{"note":"Webpack v1 uses 'loaders' and 'loader' (string); v2+ uses 'rules' and 'use'. The documentation uses v1 style.","wrong":"module.exports = { module: { loaders: [ { test: /\\.js$/, loader: 'unlazy' } ] } }","symbol":"unlazy-loader (webpack rule configuration)","correct":"module.exports = { module: { rules: [ { test: /\\.js$/, use: 'unlazy-loader' } ] } }"},{"note":"This loader is designed to transform lazy-cache calls; it does not replace the import itself.","wrong":"const lazy = require('lazy-cache')(require); const foo = lazy('foo');","symbol":"lazy-cache","correct":"import lazyCache from 'lazy-cache'; const lazy = lazyCache(require); const foo = lazy('foo');"},{"note":"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.","wrong":"{ test: /\\.js$/, loader: 'unlazy' }","symbol":"webpack configuration (module.rules)","correct":"{ test: /\\.js$/, use: 'unlazy-loader' }"}],"quickstart":{"code":"// webpack.config.js\nconst path = require('path');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js'\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        use: 'unlazy-loader'\n      }\n    ]\n  }\n};","lang":"javascript","description":"Basic webpack configuration to apply unlazy-loader to all JavaScript files, transforming lazy-cache requires into direct requires."},"warnings":[{"fix":"Consider using babel-plugin-lazy-cache or manually converting lazy-cache calls to direct imports.","message":"Package is effectively unmaintained since 2016. No updates for Node.js or webpack compatibility. Use at your own risk.","severity":"deprecated","affected_versions":"all"},{"fix":"Update webpack config to use 'rules' array and 'use' property.","message":"Webpack v2+ changed loader configuration syntax. Using old 'loaders' array and 'loader' property may fail silently or produce errors.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Ensure your source files use CommonJS require pattern for lazy-cache (e.g., const lazy = require('lazy-cache')(require)).","message":"The loader expects lazy-cache to be used with require context (commonjs). It may not work with ES module imports.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install unlazy-loader --save-dev' and ensure it's in the project's node_modules.","cause":"unlazy-loader is not installed or not resolved correctly.","error":"Module not found: Error: Can't resolve 'unlazy-loader'"},{"fix":"Change 'module.loaders' to 'module.rules' and 'loader' to 'use' in webpack config.","cause":"Using webpack v2+ with 'loaders' array instead of 'rules' array.","error":"Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema."},{"fix":"Ensure you use 'const lazy = require('lazy-cache')(require)' in your source files.","cause":"The lazy-cache function was not called with the require context; this loader expects specific usage.","error":"lazy-cache requires a require function to be passed"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}