{"library":"source-map-loader","title":"source-map-loader","type":"library","description":"Webpack loader that extracts inline and linked source maps from JavaScript files, including from node_modules, so webpack can process them for the generated bundle. Current stable version is 5.0.0 (2024-01-15), with major releases roughly yearly. Key differentiator: it ensures source map continuity across third-party libraries, preventing misinterpretation by browsers. Requires webpack 5+ and Node.js 18.12+ as of v5. Supports a filterSourceMappingUrl option to control per-file behavior.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install source-map-loader"],"cli":null},"imports":["module.exports = { module: { rules: [{ test: /\\.js$/, enforce: 'pre', use: ['source-map-loader'] }] } }","const sourceMapLoader = require('source-map-loader'); // not typical","options: { filterSourceMappingUrl: (url, resourcePath) => { ... } }"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/webpack-contrib/source-map-loader","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/source-map-loader","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        enforce: 'pre',\n        use: ['source-map-loader'],\n      },\n    ],\n  },\n  ignoreWarnings: [/Failed to parse source map/],\n};\n\n// Then run webpack\n> npx webpack --mode development","lang":"javascript","description":"Configures source-map-loader to process all JavaScript files before other loaders, extracting source maps. Includes ignoring parse warnings typical for third-party libraries.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}