Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup: Replace addons three.module.js dependency. #20389

Merged
merged 1 commit into from
Sep 23, 2020
Merged

Rollup: Replace addons three.module.js dependency. #20389

merged 1 commit into from
Sep 23, 2020

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Sep 22, 2020

This allows producing custom builds that include addons.

For example, adding OrbitControls:

  1. Add export { OrbitControls } from '../examples/jsm/controls/OrbitControls.js'; in ./src/Three.js.
  2. Run npm run build

Fixes #20387

@mrdoob mrdoob added this to the r121 milestone Sep 22, 2020
@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 22, 2020

Unrelated to this PR but related to the rollup build^^: I've noticed lately the following warning when performing the build:

(!) Broken sourcemap
[ROLLUP] https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect
[ROLLUP] Plugins that transform code (such as 'at position 5') should generate accompanying sourcemaps

Unfortunately, I'm not sure when this warning appeared for the first time 🤔 .

@DefinitelyMaybe
Copy link
Contributor

I'd love to get into writing up some documentation around folks creating custom builds and/or tweeking three.js for specific applications

@mrdoob
Copy link
Owner Author

mrdoob commented Sep 23, 2020

@Mugen87 Weird, I'm not getting that 🤔

@mrdoob mrdoob merged commit f93563c into dev Sep 23, 2020
@mrdoob mrdoob deleted the rollup branch September 23, 2020 06:22
@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 6, 2023

When removing build/three.js and build/three.min.js and updating package.json, I've noticed addons() and wondered if we still need it. AFAICS, the helper was originally implemented in 2020 when we have not used import maps yet, see #20387 (comment).

Now with import maps in place and a pure ESM code base, can we simplify rollup.config.js and remove the addons() helper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom build produces files too large
3 participants