rollup-plugin-resolve
raw JSON → 0.0.1-predev.1 verified Mon Apr 27 auth: no javascript deprecated
A rollup plugin that wraps the Node.js resolution algorithm for module resolution. Currently at version 0.0.1-predev.1, this package is in pre-release state with no stable releases. It serves as a resolver for Rollup, similar to @rollup/plugin-node-resolve but with no documentation or usage guidance. Not recommended for production use due to its early stage.
Common errors
error Error: Cannot find module 'rollup-plugin-resolve' ↓
cause Package not installed or not published to npm correctly.
fix
Run 'npm install rollup-plugin-resolve@0.0.1-predev.1' and verify node_modules.
error TypeError: resolve is not a function ↓
cause Named import used instead of default import.
fix
Change import to 'import resolve from 'rollup-plugin-resolve''.
Warnings
deprecated This package is in pre-release (0.0.1-predev.1) and lacks documentation. Consider using @rollup/plugin-node-resolve instead. ↓
fix Replace with 'npm install @rollup/plugin-node-resolve' and update import.
gotcha Default export is a function, not a plugin instance. Must call it with options to get a plugin object. ↓
fix Use resolve() (with parentheses) in plugins array, not resolve alone.
breaking No stable version exists; API may change without notice. ↓
fix Pin to a specific version or migrate to a maintained plugin.
Install
npm install rollup-plugin-resolve yarn add rollup-plugin-resolve pnpm add rollup-plugin-resolve Imports
- default wrong
import { resolve } from 'rollup-plugin-resolve'correctimport resolve from 'rollup-plugin-resolve' - resolve (CommonJS) wrong
const { resolve } = require('rollup-plugin-resolve')correctconst resolve = require('rollup-plugin-resolve') - resolve (with options) wrong
import { resolve } from 'rollup-plugin-resolve'; const plugin = resolve({ ... })correctimport resolve from 'rollup-plugin-resolve'; const plugin = resolve({ ... })
Quickstart
import resolve from 'rollup-plugin-resolve';
import builtins from 'builtin-modules';
export default {
input: 'src/main.js',
output: { file: 'bundle.js', format: 'esm' },
plugins: [resolve({
builtins: false,
customResolveOptions: { moduleDirectory: ['node_modules'] }
})]
};