{"id":22202,"library":"rollup-plugin-resolve-alias","title":"rollup-plugin-resolve-alias","description":"A Rollup plugin to create module import aliases, simplifying paths in bundled code. Current stable version is 0.2.1, with no active development since 2018. It provides a simple API via an 'aliases' object, but lacks features like array aliases or custom resolvers found in more modern alternatives like @rollup/plugin-alias. Ships TypeScript types. Requires Rollup >=0.20.0. Use with caution for new projects; prefer @rollup/plugin-alias instead.","status":"deprecated","version":"0.2.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","rollup","rollup-plugin","resolve","alias","aliases","typescript"],"install":[{"cmd":"npm install rollup-plugin-resolve-alias","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-resolve-alias","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-resolve-alias","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required as plugin for Rollup","package":"rollup","optional":false}],"imports":[{"note":"ESM-only; CommonJS require not supported (package has no CJS export).","wrong":"const resolveAlias = require('rollup-plugin-resolve-alias')","symbol":"default","correct":"import resolveAlias from 'rollup-plugin-resolve-alias'"},{"note":"Default export, not named. Named import will result in undefined.","wrong":"import { resolveAlias } from 'rollup-plugin-resolve-alias'","symbol":"resolveAlias","correct":"import resolveAlias from 'rollup-plugin-resolve-alias'"},{"note":"TypeScript types are included; use 'import type' for type-only imports.","wrong":"","symbol":"types","correct":"import type { RollupPluginResolveAliasOptions } from 'rollup-plugin-resolve-alias'"}],"quickstart":{"code":"import resolveAlias from 'rollup-plugin-resolve-alias';\n\nexport default {\n  input: 'src/main.js',\n  output: { file: 'bundle.js', format: 'cjs' },\n  plugins: [\n    resolveAlias({\n      aliases: {\n        '@': './src',\n        'utils': './src/utils'\n      }\n    })\n  ]\n};","lang":"javascript","description":"Shows basic usage of rollup-plugin-resolve-alias with two aliases to map module paths."},"warnings":[{"fix":"Replace with @rollup/plugin-alias: npm install @rollup/plugin-alias -D and update config.","message":"Package is no longer maintained. Consider using @rollup/plugin-alias instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"If migrating from 0.1.x, change the plugin configuration to use the 'aliases' key instead of top-level mappings.","message":"Version 0.2.0 changed the API from an options object with 'resolve' to the current 'aliases' object.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Ensure aliases resolve correctly by using absolute paths or paths relative to process.cwd().","message":"Alias values must be absolute paths or relative to the project root, not relative to the importing file.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install rollup-plugin-resolve-alias --save-dev' or ensure it's in devDependencies.","cause":"Package not installed or installed incorrectly.","error":"Error: Cannot find module 'rollup-plugin-resolve-alias'"},{"fix":"Use ES module syntax: import resolveAlias from 'rollup-plugin-resolve-alias'","cause":"CommonJS require used instead of ESM import.","error":"TypeError: resolveAlias is not a function"},{"fix":"Pass an object with an 'aliases' key: resolveAlias({ aliases: { '@': './src' } })","cause":"Calling resolveAlias() without passing an options object.","error":"Uncaught TypeError: Cannot destructure property 'aliases' of 'undefined' or 'null'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}