{"id":22081,"library":"rollup-plugin-includepaths","title":"rollup-plugin-includepaths","description":"A Rollup plugin that allows importing modules using relative paths from configured base directories. Version 0.2.4 is the latest stable release (August 2020), with no further updates expected. It helps avoid deep relative imports by defining alias paths, similar to Webpack's resolve.alias. Unlike @rollup/plugin-alias, this plugin supports multiple path prefixes and automatic file extension resolution. Lightweight with no runtime dependencies, but unmaintained since 2020.","status":"maintenance","version":"0.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/dot-build/rollup-plugin-includepaths","tags":["javascript","rollup-plugin","rollup","es6"],"install":[{"cmd":"npm install rollup-plugin-includepaths","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-includepaths","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-includepaths","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import; commonJS require works but Babel may be needed for interop.","wrong":"const includePaths = require('rollup-plugin-includepaths');","symbol":"includePaths","correct":"import includePaths from 'rollup-plugin-includepaths';"},{"note":"Options object is not exported; it's the argument to the default function.","wrong":null,"symbol":"options","correct":"import includePaths from 'rollup-plugin-includepaths';\nconst options = { paths: ['src/lib'] };"}],"quickstart":{"code":"// rollup.config.js\nimport includePaths from 'rollup-plugin-includepaths';\n\nexport default {\n  input: 'src/main.js',\n  output: { file: 'dist/bundle.js', format: 'cjs' },\n  plugins: [\n    includePaths({\n      paths: ['src/lib', 'src/other'],\n      external: [],\n      extensions: ['.js', '.json', '.html']\n    })\n  ]\n};\n\n// Now in any file inside src/lib or src/other, use:\n// import { Foo } from 'one/foo';  // resolves to src/lib/one/foo.js or src/other/one/foo.js","lang":"javascript","description":"Configures Rollup to resolve imports relative to 'src/lib' and 'src/other', allowing short paths like 'one/foo'."},"warnings":[{"fix":"Migrate to '@rollup/plugin-alias' with similar configuration.","message":"No updates since 2020; consider using @rollup/plugin-alias for active maintenance.","severity":"deprecated","affected_versions":">=0.2.4"},{"fix":"Always specify an explicit paths array in options.","message":"If no paths option is given, the plugin resolves from the current working directory, which may cause unexpected matches.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use @rollup/plugin-node-resolve alongside this plugin for node_modules resolution.","message":"The plugin does not handle node_modules by default; it only looks in the provided paths.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade Node.js to >=6 or stick with 0.1.x.","message":"Version 0.2.0 dropped support for Node.js <6; may break on older runtimes.","severity":"breaking","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Add the module path to the 'paths' array or use 'include' option with explicit file path.","cause":"The module name is not found in any of the configured paths or the include map.","error":"Error: Could not resolve 'someModule' from '...'"},{"fix":"Use default import: 'import includePaths from 'rollup-plugin-includepaths''","cause":"Using import incorrectly, e.g., 'import { includePaths } from 'rollup-plugin-includepaths''","error":"TypeError: includePaths is not a function"},{"fix":"Run 'npm install rollup-plugin-includepaths --save-dev'","cause":"Plugin not installed or package missing from node_modules.","error":"Error: Cannot find module 'rollup-plugin-includepaths'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}