Skip to content

three/nodes requires package.json#exports or import maps, consider relative imports #27354

@hybridherbst

Description

@hybridherbst

Description

I'm somewhat confused why some import references are done this way:

This code seems to assume that something defines what three/nodes is.
In practice, that means that a importmap is required – and that it's hard to use this code at all when importmaps are not available (e.g. in most bundlers/frameworks).

In vite one needs to do something like this:

        resolve: {
            alias: {
                "three/nodes": "three/examples/jsm/nodes/Nodes.js",
            },
        },

and then in Next it's different, in bun it's different, ...

I know that previously great care was taken to use relative references throughout the codebase, e.g. here:

Is there a specific reason for when "indirect" references are used (not sure what the right name is) vs. when relative references are used? Are absolute references considered a bug / could I make PRs to fix them?

Version

r159

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions