Skip to content

External modules are resolved / re-written instead of being ignored #609

@matthew-dean

Description

@matthew-dean
  • Rollup Plugin Name: @rollup/plugin-node-resolve
  • Rollup Plugin Version: 9.0.0
  • Rollup Version: 2.30.0
  • Operating System (or Browser): macOS 10.15.7
  • Node Version: 10.22.0
  • Link to reproduction: https://repl.it/join/xdisrknw-matthewdean2

Expected Behavior

  • External modules should not be resolved / re-written, as they are, by definition, external

Actual Behavior

  • External modules are re-written with a /node_modules/ path. This prevents the Rollup-bundled library from being imported as a module into another repo, as dependencies will not be local to the original repo, they will be installed as dependencies in the importing repo.

For example this line:
import axios from 'axios'
should remain:
import axios from 'axios'

Instead, it turns into:
import axios from './node_modules/axios/index.js';

Additional Information

Any temporary workarounds to this behavior would be welcome.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions