-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress
Description
ESM requires that relative imports be fully specified. For example, these are not allowed:
import stuff from './subdir';
import otherStuff from './a-file';Instead these must be written like this:
import stuff from './subdir/index.js';
import otherStuff from './a-file.js';Some tooling is lenient in this respect, while other tooling requires it. Webpack, for example, enforces this when the file is supposed to contain ESM code (but not when it’s supposed to be CommonJS even though Webpack accepts ESM content, which is why you’re not seeing this already, but that’s a different bug).
Let's stick to ESM-compliant code so packages can be consumed in an environment-agnostic setup without special configuration.
In the meantime, people using Webpack to consume these packages can set resolve.fullySpecified to work around this. There may be similar workarounds available for other bundlers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress