Skip to content

Easy for life when you need to use the js contribs in threejs example folders.

License

Notifications You must be signed in to change notification settings

sevenryze/three-contrib-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm node deps tests coverage chat

Threejs Contrib Loader

Install

npm install --save-dev three-contrib-loader

⚠️ I don't know if threejs core project will change the release mental to correct this inconvenient issue, so this loader is a hot-fix hack and you should watch the threejs project to follow the future change.

Usage

import * as THREE from "three";
import * as OrbitControlsFactory from "three/examples/js/controls/OrbitControls";

OrbitControlsFactory(THREE);

// Now, THREE entity should have OrbitControls appended.
let controls = new THREE.OrbitControls();

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        // The delimiter of path fragment of stupid windows has the format "//"
        test: /three.*examples.*js/,
        use: [
          {
            loader: "three-contrib-loader"
          }
        ]
      }
    ]
  }
};

Maintainer


Seven Ryze

About

Easy for life when you need to use the js contribs in threejs example folders.

Resources

License

Stars

Watchers

Forks

Packages

No packages published