Skip to content

[node-resolve]: the external module render path is not expected #1873

@underfin

Description

@underfin
  • Rollup Plugin Name:
  • Rollup Plugin Version:
  • Rollup Version:
  • Operating System (or Browser):
  • Node Version:
  • Link to reproduction (⚠️ read below):

Expected Behavior

Expected render external module path with absolute path.

Actual Behavior

Get render external module path with original module request path.

Additional Information

reproduction
https://stackblitz.com/edit/github-ttay3lbj?file=package.json,rolldown.config.mjs,entry.js,rollup.config.js,rollup-without-node-resolve.config.js

Run npm run rollup::build:without-node-resolve, it using node js resolve instead of node-resolve plugin, here output

import { rollup } from 'file:///home/projects/vbwimvyraa.github/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/rollup.js';

Run npm run build:rollup, it using node resolver plugin, here output

import { rollup } from 'rollup';

It caused by https://github.com/rollup/plugins/blob/master/packages/node-resolve/src/index.js#L329-L331. The rollup core is using 'file:///home/projects/vbwimvyraa.github/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/rollup.js' to check external and find it is a external absolute module. But the node-resolve plugin overwrite it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions