{"id":20881,"library":"yml-loader","title":"yml-loader","description":"YAML loader for webpack that imports .yml files as JSON objects. Version 2.1.0 is the latest stable release. This loader supports multiple documents via the `multiDocument` option and key blacklisting via `keysToRemove` to exclude sensitive keys from output. It is commonly used in webpack configurations to load YAML configuration files. The package is unmaintained since 2019 and relies on `js-yaml` for parsing. Alternatives like `yaml-loader` offer more active maintenance and broader compatibility with webpack 4+.","status":"maintenance","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/nkt/yml-loader","tags":["javascript","yaml","json","remove","keys","blacklist","loader","webpack","webpack-loader"],"install":[{"cmd":"npm install yml-loader","lang":"bash","label":"npm"},{"cmd":"yarn add yml-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add yml-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core YAML parsing dependency. Used to load and parse YAML files.","package":"js-yaml","optional":false},{"reason":"Peer dependency; loader is designed for webpack bundler.","package":"webpack","optional":true}],"imports":[{"note":"Loader is used in webpack config, not in application code. Import syntax shown is illustrative; actual usage is via webpack loader string.","wrong":"const yml = require('yml-loader')","symbol":"yml-loader","correct":"import yml from 'yml-loader'"},{"note":"Webpack 1 uses `loaders` with `loader`; webpack 2+ uses `rules` with `use`. This package documentation still shows webpack 1 style.","wrong":"module.exports = { module: { loaders: [ { test: /\\.yml$/, loader: 'yml' } ] } }","symbol":"webpack config","correct":"module.exports = { module: { rules: [ { test: /\\.yml$/, use: 'yml-loader' } ] } }"}],"quickstart":{"code":"// In webpack config\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.ya?ml$/,\n        use: [\n          {\n            loader: 'yml-loader',\n            options: {\n              keysToRemove: ['private_key']\n            }\n          }\n        ]\n      }\n    ]\n  }\n};\n\n// Then in your code\nimport config from './config.yml';\nconsole.log(config); // outputs parsed YAML as JS object","lang":"javascript","description":"Shows how to configure webpack to load YAML files using yml-loader with key removal option."},"warnings":[{"fix":"Use `module.rules` array with `use` property for webpack 2+.","message":"Webpack 1 loader syntax is incompatible with webpack 2+. Use `rules` and `use` instead of `loaders` and `loader`.","severity":"breaking","affected_versions":">=0.0.0 <2.0.0"},{"fix":"Consider migrating to `yaml-loader` (npm: yaml-loader) which is actively maintained.","message":"Package is unmaintained since 2019; no updates for webpack 5 compatibility.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install with `npm install --save-dev yml-loader`.","cause":"Loader not installed or not in node_modules.","error":"Module not found: Error: Can't resolve 'yml-loader'"},{"fix":"Install `js-yaml` with `npm install --save-dev js-yaml`.","cause":"Missing peer dependency `js-yaml`.","error":"Module build failed: Error: Cannot find module 'js-yaml'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}