Skip to content

Three.js dev iteration process, bundling has become really slow #30829

Closed
@gkjohnson

Description

@gkjohnson

Description

I'm not exactly sure when it happened but modifying three.js core and checking the changes in the example files has become really difficult. The changes used to be reflected almost immediately but now it takes several seconds for anything to change resulting in a lack of trust around whether the latest changes are being displayed. And even then once the page does change it initially logs an error that a subfile is not yet available (because it's still being built):

Uncaught SyntaxError: The requested module './three.core.js' does not provide an export named 'UniformsUtils' (at three.module.js:6:1049)

I suspect this is because with WebGPU and TSL there have become 6 build targets that are also built even if not needed during dev.

Solution

  • Produce a separate "dev" rollup config that builds what's necessary focused on iteration speed, removing code splitting, multiple build targets.
  • Possibly produce a separate dev command for WebGPURenderer and WebGLRenderer if speed continues to be a problem to minimize files being built.
  • Import three.js directly from source during development so no build is required.

Alternatives

  • Switch to another, faster build process.
  • Tolerate unnecessary build delay, lack of trust in dev bundle process.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions