{"library":"raw-loader","title":"raw-loader","description":"Webpack loader that imports files as a string. Current stable version 4.0.2 (2020-10-09), maintained by webpack-contrib. Supports webpack 4 and 5. Key differentiator: minimal, zero-config loader for raw text files. Alternatives like file-loader or url-loader create separate files; raw-loader inlines content as a string. Enables ES module or CommonJS output via the `esModule` option (default true, changed in v4.0.0). Requires Node >= 10.13.0.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install raw-loader"],"cli":null},"imports":["import txt from './file.txt';","import txt from 'raw-loader!./file.txt';","module.exports = { module: { rules: [ { test: /\\.txt$/i, use: 'raw-loader' } ] } };"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.txt$/i,\n        use: 'raw-loader',\n      },\n    ],\n  },\n};\n\n// file.txt: Hello World\n// entry.js\nimport content from './file.txt';\nconsole.log(content); // 'Hello World'","lang":"javascript","description":"Configures webpack to load .txt files as strings using raw-loader.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}