{"id":45559,"library":"no-cache-loader","title":"no-cache-loader","description":"A webpack loader that disables caching by returning a new module instance on each require call. Version 1.0.0. Useful for loading mutable data like JSON fixtures where module identity must differ. Simple and focused; no release cadence documented, likely maintenance mode. Only 4 lines of source code.","status":"maintenance","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/maxkostow/no-cache-loader","tags":["javascript","webpack","cache","loader"],"install":[{"cmd":"npm install no-cache-loader","lang":"bash","label":"npm"},{"cmd":"yarn add no-cache-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add no-cache-loader","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"For direct usage as a webpack rule, specify loader string 'no-cache-loader'. Not meant for programmatic import.","wrong":"const noCacheLoader = require('no-cache-loader')","symbol":"default","correct":"import noCacheLoader from 'no-cache-loader'"},{"note":"In webpack config, use full package name 'no-cache-loader' not 'no-cache'.","wrong":"module: { rules: [{ test: /\\.json$/, loader: 'no-cache' }] }","symbol":"no-cache-loader (webpack config)","correct":"module: { rules: [{ test: /\\.json$/, use: 'no-cache-loader' }] }"},{"note":"Inline usage: always include 'no-cache-loader' not 'no-cache'.","wrong":"require('no-cache!./module.js')","symbol":"inline usage","correct":"require('no-cache-loader!./module.js')"}],"quickstart":{"code":"// Install: npm install --save no-cache-loader\n// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.json$/,\n        use: 'no-cache-loader'\n      }\n    ]\n  }\n};\n// Then in your code:\nconst obj1 = require('./data.json');\nconst obj2 = require('./data.json');\nconsole.log(obj1 === obj2); // false - different objects each time","lang":"javascript","description":"Shows how to configure no-cache-loader in webpack to avoid caching of JSON modules, ensuring each require returns a fresh instance."},"warnings":[{"fix":"For production use, consider a more robust solution or test thoroughly.","message":"Loader is extremely simple (4 lines) and may not handle edge cases like errors or large files gracefully.","severity":"gotcha","affected_versions":"<=1.0.0"},{"fix":"Use only in webpack builds.","message":"Only works with webpack. Not compatible with other bundlers or Node.js require.","severity":"gotcha","affected_versions":"<=1.0.0"},{"fix":"Be mindful of performance. Use only when module identity mutability is required.","message":"No caching at all - each require() will re-execute the module logic, which can impact performance if called frequently.","severity":"gotcha","affected_versions":"<=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':22 '4':47 'cach':3,10,54 'cadenc':41 'call':20 'code':51 'data':27 'differ':35 'disabl':9 'document':42 'fixtur':30 'focus':38 'ident':33 'instanc':16 'javascript':52 'json':29 'like':28,43 'line':48 'load':25 'loader':4,7,55 'mainten':44 'mode':45 'modul':15,32 'must':34 'mutabl':26 'new':14 'no-cache-load':1 'releas':40 'requir':19 'return':12 'simpl':36 'sourc':50 'use':23 'version':21 'webpack':6,53","created_at":"2026-06-07T12:55:36.695104+00:00","updated_at":"2026-06-07T12:55:36.695104+00:00","problems":[{"fix":"Change to 'no-cache-loader': require('no-cache-loader!./module.js') or { test: /\\.json$/, use: 'no-cache-loader' }.","cause":"Using 'no-cache' instead of 'no-cache-loader' in webpack config or inline require.","error":"Module not found: Error: Can't resolve 'no-cache' in ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/maxkostow/no-cache-loader#readme","github":"https://github.com/maxkostow/no-cache-loader","docs":null,"changelog":null,"pypi":null,"npm":"no-cache-loader","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}