Skip to content

Avoid bare imports other than 'three' #23625

@donmccurdy

Description

@donmccurdy

Related:

With r138 the following syntax was introduced:

import { NormalNode } from 'three-nodes/Nodes.js';

I do not think we should be using bare imports (except three) unless we are publishing it to a separate NPM package. Bundlers cannot resolve three-nodes without custom resolution configuration, and we're seeing confusion about this in Discord. By contrast, anything under the three import is fine if we configure it in package.json exports:

import { NormalNode } from 'three/nodes/Nodes.js';

/cc @sunag

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions