_webpack_require() is not a function

vue项目中引用 three 报错

      _webpack_require() is not a function

 

解决方法:

import * as THREE from "three";
const OrbitControls = require("three-orbit-controls")(THREE);

  修改为

import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";

 

posted @ 2022-03-21 16:51  _houjie  阅读(334)  评论(0编辑  收藏  举报