three-contrib-loader
v1.0.1
Published
threejs contrib loader module for webpack
Downloads
5
Readme
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.
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"
}
]
}
]
}
};