A Rollup plugin for defining import aliases with exact string matching (===) rather than prefix matching (startsWith). Version 1.0.0 is the current stable release. This plugin emulates Webpack's resolve.alias behavior, avoiding false positives that occur with substring replacement (e.g., 'react' won't accidentally match 'react-router'). It supports local file resolution with configurable extensions. Unlike rollup-plugin-alias, this plugin provides strict alias substitution and handles submodule imports (e.g., 'lodash/map'). The package is authored by adriantoine and has minimal maintenance commitment; last release is final. Suitable for projects using Rollup that need precise alias mapping.
npm install rollup-plugin-strict-aliasVerified import paths — ran on the pinned version, not inferred.
Configures Rollup with strict aliases for 'react' and 'lodash', then bundles an ES module.
Define aliases for full import paths if submodule mapping is needed, or use a plugin that supports wildcard/regex patterns.
Consider using alternative plugins like @rollup/plugin-alias (maintained by the Rollup team).
Use absolute paths or ensure the alias path is correct relative to process.cwd().
Provide an explicit `resolve` array with the extensions you want (e.g., ['.js', '.jsx']).
Ensure this plugin is placed early in the plugins array, before any plugin that transforms imports.
Run `npm install rollup-plugin-strict-alias --save-dev` or add to package.json dependencies.
Change to `import alias from 'rollup-plugin-strict-alias'`.
Check the path and ensure the file exists with an extension included in the `resolve` option. Use absolute paths if needed.
No dependency data recorded yet.